Packages

p

org.mellowtech

jsonclient

package jsonclient

Since

2016-12-28

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. jsonclient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Package Members

  1. package cmd

Type Members

  1. case class EmptyResponse(status: Int) extends JsonClientResponse with Product with Serializable
  2. case class HttpHeader(name: String, value: String) extends Product with Serializable
  3. 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
    }
  4. class JsonClientException extends Exception
  5. sealed trait JsonClientRequest extends AnyRef
  6. sealed trait JsonClientResponse extends AnyRef

    Since

    20/09/16

  7. class JsonEmptyResponseRequest extends JsonClientRequest
  8. class JsonRequest[A] extends JsonClientRequest
  9. case class JsonResponse[T](status: Int, body: T) extends JsonClientResponse with Product with Serializable
  10. case class StringResponse(status: Int, body: String) extends JsonClientResponse with Product with Serializable

Value Members

  1. object HttpHeaders
  2. object HttpMethod extends Enumeration
  3. object JsonClient
  4. object JsonRequest

Inherited from AnyRef

Inherited from Any

Ungrouped