tyrian.http

package tyrian.http

Type members

Classlikes

enum Body

The body of a request

The body of a request

Companion:
object
object Body
Companion:
class
object Decoder
final case class Header(name: String, value: String)

A request header

A request header

Value parameters:
name

header field name

value

header field value

object Http

Send HTTP requests as a command

Send HTTP requests as a command

An Error will be returned if something goes wrong with an HTTP request.

An Error will be returned if something goes wrong with an HTTP request.

enum Method

An HTTP method

An HTTP method

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

Describes an HTTP request.

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

duration to wait before giving up.

url

the url

withCredentials

indicates if the request is using credentials

Companion:
object
object Request
Companion:
class
final case class Response(url: String, status: Status, headers: Map[String, String], body: String)

The response from an HTTP request.

The response from an HTTP request.

Type parameters:
A

type of the response body

Value parameters:
body

the response body

headers

the response headers

status

the status code

url

the url

final case class Status(code: Int, message: String)

The response status code

The response status code

Value parameters:
code

the status code

message

the status message

Types

opaque type Decoder[Msg]

Tries to transform an response body or http error into to a value of type Msg.

Tries to transform an response body or http error into to a value of type Msg.

Type parameters:
Msg

Message type of the successfully decoded response