package jsonclient
- Since
2016-12-28
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- jsonclient
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
Type Members
- case class EmptyResponse(status: Int) extends JsonClientResponse with Product with Serializable
- case class HttpHeader(name: String, value: String) extends Product with Serializable
- class JsonClient extends AnyRef
HttpClient that simplifies json requests and responses by automatically serialize/deserialize native objects to and from json.
HttpClient that simplifies json requests and responses by automatically serialize/deserialize native objects to and from json. JsonClient is fully asynchronous.
import org.mellowtech.jsonclient.{JsonClient,JsonResponse} import scala.concurrent.Await import scala.concurrent.duration._ case class ServerResponse(key: String, value: String) object Test { import scala.concurrent.ExecutionContext.Implicits.global implicit val formats = org.json4s.DefaultFormats val jc = JsonClient() val resp = jc.get[ServerResponse]("http://pathToServiceApi") var res = Await.result(resp, 4 seconds) res.body match { case Some(sr) => println(sr) case None => println(res.statusCode } jc.close }
- class JsonClientException extends Exception
- sealed trait JsonClientRequest extends AnyRef
- sealed trait JsonClientResponse extends AnyRef
- Since
20/09/16
- class JsonEmptyResponseRequest extends JsonClientRequest
- class JsonRequest[A] extends JsonClientRequest
- case class JsonResponse[T](status: Int, body: T) extends JsonClientResponse with Product with Serializable
- case class StringResponse(status: Int, body: String) extends JsonClientResponse with Product with Serializable
Value Members
- object HttpHeaders
- object HttpMethod extends Enumeration
- object JsonClient
- object JsonRequest