HttpClientF

com.malliina.http.io.HttpClientF
abstract class HttpClientF[F[_]]()(implicit F: MonadError[F, Throwable]) extends HttpClient[F]

Attributes

Graph
Supertypes
trait HttpClient[F]
trait Closeable
trait AutoCloseable
class Object
trait Matchable
class Any
Show all
Known subtypes
class HttpClientF2[F]
class HttpClientIO

Members list

Type members

Inherited classlikes

implicit class FOps[T](f: F[T])

Attributes

Inherited from:
HttpClient
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

override def execute(request: Request): F[OkHttpResponse]

Attributes

Definition Classes
HttpClient
override def fail[T](e: Exception): F[T]

Attributes

Definition Classes
HttpClient
override def flatMap[T, U](t: F[T])(f: T => F[U]): F[U]

Attributes

Definition Classes
HttpClient
override def success[T](t: T): F[T]

Attributes

Definition Classes
HttpClient

Inherited methods

def close(): Unit

Attributes

Inherited from:
HttpClient
def download(url: FullUrl, to: Path, headers: Map[String, String]): F[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 parameters

headers

http headers

to

destination, a file

url

url to download

Attributes

Returns

bytes written

Inherited from:
HttpClient
def get(url: FullUrl, headers: Map[String, String]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def getAs[T : Decoder](url: FullUrl, headers: Map[String, String]): F[T]

Attributes

Inherited from:
HttpClient
def multiPart(url: FullUrl, headers: Map[String, String], parts: Map[String, String], files: Seq[MultiPartFile]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def parse[T : Decoder](response: OkHttpResponse, url: FullUrl): F[T]

Parses the response as a T.

Parses the response as a T.

The returned Future fails with a ResponseError if parsing fails.

Type parameters

T

type to parse

Value parameters

response

HTTP response

url

the request URL

Attributes

Returns

a parsed response

Inherited from:
HttpClient
def post(url: FullUrl, body: RequestBody, headers: Map[String, String]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def postAs[W : Encoder, T : Decoder](url: FullUrl, json: W, headers: Map[String, String]): F[T]

Attributes

Inherited from:
HttpClient
def postFile(url: FullUrl, mediaType: MediaType, file: Path, headers: Map[String, String]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def postForm(url: FullUrl, form: Map[String, String], headers: Map[String, String]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def postFormAs[T : Decoder](url: FullUrl, form: Map[String, String], headers: Map[String, String]): F[T]

Attributes

Inherited from:
HttpClient
def postJson(url: FullUrl, json: Json, headers: Map[String, String]): F[OkHttpResponse]

Attributes

Inherited from:
HttpClient
def postJsonAs[T : Decoder](url: FullUrl, json: Json, headers: Map[String, String]): F[T]

Attributes

Inherited from:
HttpClient
def raw(request: Request): F[Response]

Attributes

Inherited from:
HttpClient
def streamed[T](request: Request)(consume: Response => F[T]): F[T]

Attributes

Inherited from:
HttpClient

Implicits

Inherited implicits

final implicit def FOps[T](f: F[T]): FOps[T]

Attributes

Inherited from:
HttpClient