Request

final case class Request[A](method: Method, headers: List[Header], url: String, body: Body, expect: Response[String] => Either[String, A], timeout: Option[FiniteDuration], withCredentials: Boolean)

Describes an HTTP request.

Type parameters:
A

type of the successfully decoded response

Value parameters:
body

the request body (EmptyBody or StringBody(contentType: String, body: String))

expect

tries to transform a Response[String] to a value of type A

headers

a list of request headers

method

GET, POST, PUT, PATCH, DELETE, or OPTIONS

timeout

an optional timeout

url

the url

withCredentials

indicates if the request is using credentials

Companion:
object
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Value members

Concrete methods

def addHeaders(newHeaders: List[Header]): Request[A]
def addHeaders(newHeaders: Header*): Request[A]
def withBody(newBody: Body): Request[A]
def withExpectation(newExpectation: Response[String] => Either[String, A]): Request[A]
def withHeaders(newHeaders: List[Header]): Request[A]
def withHeaders(newHeaders: Header*): Request[A]
def withMethod(newMethod: Method): Request[A]
def withTimeout(newTimeout: FiniteDuration): Request[A]
def withUrl(newUrl: String): Request[A]

Inherited methods

Inherited from:
Product