Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait LowPriorityHttpReadsJsontrait HttpReadsJsontrait HttpReadsOptiontrait HttpReadsTrytrait HttpReadsEithertrait HttpReadsHttpResponseclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
object Implicitsobject HttpReadsInstances
Members list
Value members
Inherited methods
Attributes
- Inherited from:
- HttpReadsEither
Implicits
Inherited implicits
Attributes
- Inherited from:
- HttpReadsEither
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.
Attributes
- Inherited from:
- LowPriorityHttpReadsJson
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")
})
Attributes
- Inherited from:
- HttpReadsJson
Attributes
- Inherited from:
- HttpReadsJson
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:
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)
Attributes
- Inherited from:
- HttpReadsOption
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.
Attributes
- Inherited from:
- HttpReadsHttpResponse
Attributes
- Inherited from:
- HttpReadsTry
Ignores the response and returns Unit - useful for handling 204 etc. It can be combined with error handling types (e.g. Either[UpstreamErrorResponse, Unit])
Ignores the response and returns Unit - useful for handling 204 etc. It can be combined with error handling types (e.g. Either[UpstreamErrorResponse, Unit])
Attributes
- Inherited from:
- HttpReadsHttpResponse