data Method : Type HTTP methods currently supported.
Totality: total
Visibility: public export
Constructors:
GET : Method POST : Method
Hints:
Eq Method Ord Method Show Method
A HTTP header is just a pair of strings.
Totality: total
Visibility: public exportdata Part : Type Part in a formdata request.
Totality: total
Visibility: public export
Constructors:
StringPart : String -> String -> Part FilePart : String -> File -> Part
data RequestBody : Type Body of a HTTP request.
Totality: total
Visibility: public export
Constructors:
Empty : RequestBody StringBody : String -> String -> RequestBody JSONBody : ToJSON a => a -> RequestBody FormBody : List Part -> RequestBody
data HTTPError : Type HTTP Errors
Totality: total
Visibility: public export
Constructors:
Timeout : HTTPError NetworkError : HTTPError BadStatus : Bits16 -> HTTPError JSONError : String -> DecodingErr -> HTTPError
data Expect : Type -> Type Type of expected respons.
Every constructor takes a function for wrapping a request
result of type `Either HTTPError x` into the result type.
Totality: total
Visibility: public export
Constructors:
ExpectJSON : FromJSON a => (Either HTTPError a -> r) -> Expect r ExpectString : (Either HTTPError String -> r) -> Expect r ExpectAny : (Either HTTPError () -> r) -> Expect r
request : Sink r => Method -> List Header -> String -> RequestBody -> Expect r -> Maybe Bits32 -> IO1 (IO1 ()) Sends a HTTP request.
Converts the response to an event of type `r`.
Totality: total
Visibility: exportget : Sink r => String -> Expect r -> IO1 (IO1 ()) Send a GET HTTP request.
Totality: total
Visibility: exportgetText : Sink r => String -> (Either HTTPError String -> r) -> IO1 (IO1 ()) Send a GET request, reading the response as plain text.
Totality: total
Visibility: exportgetJSON : Sink r => FromJSON t => String -> (Either HTTPError t -> r) -> IO1 (IO1 ()) Send a GET request, decoding the result as a JSON string
and converting it to the result type `a`.
Totality: total
Visibility: exportpost : Sink r => String -> RequestBody -> Expect r -> IO1 (IO1 ()) Send a POST request.
Totality: total
Visibility: export