com.malliina.http.HttpClient
See theHttpClient companion object
trait HttpClient[F[_]] extends Closeable
Attributes
Members list
Type members
Classlikes
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
Value members
Concrete methods
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
def multiPart(url: FullUrl, headers: Map[String, String], parts: Map[String, String], files: Seq[MultiPartFile]): F[OkHttpResponse]
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
def postFile(url: FullUrl, mediaType: MediaType, file: Path, headers: Map[String, String]): F[OkHttpResponse]
def postForm(url: FullUrl, form: Map[String, String], headers: Map[String, String]): F[OkHttpResponse]
def postFormAs[T : Decoder](url: FullUrl, form: Map[String, String], headers: Map[String, String]): F[T]
In this article