class OkClient(val client: OkHttpClient, ec: ExecutionContext) extends HttpClient[[T] =>> Future[T]] with OkHttpBackend
- Companion
- object
trait OkHttpBackend
trait HttpClient[[T] =>> Future[T]]
trait Closeable
trait AutoCloseable
class Object
trait Matchable
class Any
Type members
Inherited classlikes
Value members
Concrete methods
Remember to close the response body if calling this method. If you don't need to stream the response,
call execute
instead.
Remember to close the response body if calling this method. If you don't need to stream the response,
call execute
instead.
- Value Params
- request
request to execute
- Returns
the response
Inherited methods
def download(url: FullUrl, to: Path, headers: Map[String, String]): Future[Either[StatusError, StorageSize]]
Downloads url
to to
, returning the number of bytes written to to
.
Downloads url
to to
, returning the number of bytes written to to
.
- Value Params
- headers
http headers
- to
destination, a file
- url
url to download
- Returns
bytes written
- Inherited from
- HttpClient
def getAs[T](url: FullUrl, headers: Map[String, String])(implicit evidence$1: Decoder[T]): Future[T]
- Inherited from
- HttpClient
def multiPart(url: FullUrl, headers: Map[String, String], parts: Map[String, String], files: Seq[MultiPartFile]): Future[OkHttpResponse]
- Inherited from
- HttpClient
Parses the response as a T.
Parses the response as a T.
The returned Future fails with a ResponseError if parsing fails.
- Type Params
- T
type to parse
- Value Params
- response
HTTP response
- url
the request URL
- Returns
a parsed response
- Inherited from
- HttpClient
def postAs[W, T](url: FullUrl, json: W, headers: Map[String, String])(implicit evidence$2: Encoder[W], evidence$3: Decoder[T]): Future[T]
- Inherited from
- HttpClient
def postFile(url: FullUrl, mediaType: MediaType, file: Path, headers: Map[String, String]): Future[OkHttpResponse]
- Inherited from
- HttpClient
def postForm(url: FullUrl, form: Map[String, String], headers: Map[String, String]): Future[OkHttpResponse]
- Inherited from
- HttpClient
def postFormAs[T](url: FullUrl, form: Map[String, String], headers: Map[String, String])(implicit evidence$5: Decoder[T]): Future[T]
- Inherited from
- HttpClient
def postJsonAs[T](url: FullUrl, json: Json, headers: Map[String, String])(implicit evidence$4: Decoder[T]): Future[T]
- Inherited from
- HttpClient