flix

0.56.0

HttpWithResult

eff HttpWithResultSource

The effect used to interact with the HTTP protocol.

Operations

def request(method: String, url: String, headers: Map[String, List[String]], body: Option[String]): Result[IoError, Response] Source

Definitions

def delete(url: String, headers: Map[String, List[String]]): Result[IoError, Response] \ HttpWithResult Source

Send a DELETE request to the given url with the given headers and wait for the response.

def get(url: String, headers: Map[String, List[String]]): Result[IoError, Response] \ HttpWithResult Source

Send a GET request to the given url with the given headers and wait for the response.

def handle(f: a -> b \ ef): a -> b \ (ef - HttpWithResult) + Net + IO Source

Handles the HttpWithResult effect of the given function f.

In other words, re-interprets the HttpWithResult effect using the Net and IO effects.

def head(url: String, headers: Map[String, List[String]]): Result[IoError, Response] \ HttpWithResult Source

Send a HEAD request to the given url with the given headers and wait for the response.

A HEAD request is identical to a GET request except that the server should not return a message-body in the response.

def options(url: String, headers: Map[String, List[String]]): Result[IoError, Response] \ HttpWithResult Source

Send an OPTIONS request to the given url with the given headers and wait for the response.

def patch(url: String, headers: Map[String, List[String]], body: String): Result[IoError, Response] \ HttpWithResult Source

Send a PATCH request to the given url with the given headers and body and wait for the response.

def post(url: String, headers: Map[String, List[String]], body: String): Result[IoError, Response] \ HttpWithResult Source

Send a POST request to the given url with the given headers and body and wait for the response.

def put(url: String, headers: Map[String, List[String]], body: String): Result[IoError, Response] \ HttpWithResult Source

Send a PUT request to the given url with the given headers and body and wait for the response.

def runWithIO(f: Unit -> a \ ef): a \ (ef - HttpWithResult) + Net + IO Source

Runs the HttpWithResult effect of the given function f.

In other words, re-interprets the HttpWithResult effect using the IO effect.

def trace(url: String, headers: Map[String, List[String]]): Result[IoError, Response] \ HttpWithResult Source

Send a TRACE request to the given url with the given headers and wait for the response.