trait HttpReadsInstances extends HttpReadsHttpResponse with HttpReadsEither with HttpReadsTry with HttpReadsOption with HttpReadsJson with LowPriorityHttpReadsJson
- Alphabetic
- By Inheritance
- HttpReadsInstances
- LowPriorityHttpReadsJson
- HttpReadsJson
- HttpReadsOption
- HttpReadsTry
- HttpReadsEither
- HttpReadsHttpResponse
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def readEitherOf[A](implicit arg0: HttpReads[A]): HttpReads[Either[UpstreamErrorResponse, A]]
- Definition Classes
- HttpReadsEither
- implicit def readFromJson[A](implicit rds: Reads[A], ct: ClassTag[A]): HttpReads[A]
This is probably the typical instance to use, since all http calls occur within
Future, allowing recovery.This is probably the typical instance to use, since all http calls occur within
Future, allowing recovery.- Definition Classes
- LowPriorityHttpReadsJson
- Annotations
- @throws(classOf[UpstreamErrorResponse]) @throws(classOf[JsValidationException])
- implicit def readJsResult[A](implicit arg0: Reads[A]): HttpReads[JsResult[A]]
Note to read json regardless of error response - can define your own:
Note to read json regardless of error response - can define your own:
HttpReads[HttpResponse].map(_.json.validate[A])
or custom behaviour - define your own:
HttpReads[HttpResponse].map(response => response.status match { case 200 => Right(response.body.json.validate[A]) case 400 => Right(response.body.json.validate[A]) case other => Left(s"Invalid status code: $other") })
- Definition Classes
- HttpReadsJson
- implicit val readJsValue: HttpReads[JsValue]
- Definition Classes
- HttpReadsJson
- implicit def readOptionOfNotFound[A](implicit arg0: HttpReads[A]): HttpReads[Option[A]]
An opinionated HttpReads which returns None for 404.
An opinionated HttpReads which returns None for 404. This does not have any special treatment for 204, as did the previous version. If you need a None for any UpstreamErrorResponse, consider using:
HttpReads[Either[UpstreamErrorResponse, A]].map(_.toOption)
- Definition Classes
- HttpReadsOption
- implicit val readRaw: HttpReads[HttpResponse]
returns the HttpResponse as is - you will be responsible for checking any status codes.
returns the HttpResponse as is - you will be responsible for checking any status codes.
- Definition Classes
- HttpReadsHttpResponse
- implicit def readTryOf[A](implicit arg0: HttpReads[A]): HttpReads[Try[A]]
- Definition Classes
- HttpReadsTry
- implicit val readUnit: HttpReads[Unit]
Ignores the response and returns Unit - useful for handling 204 etc.
Ignores the response and returns Unit - useful for handling 204 etc. It can be combined with error handling types (e.g.
Either[UpstreamErrorResponse, Unit])- Definition Classes
- HttpReadsHttpResponse
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def throwOnFailure[A](reads: HttpReads[Either[UpstreamErrorResponse, A]]): HttpReads[A]
- Definition Classes
- HttpReadsEither
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()