Idris2Doc : Web.MVC.Http

Web.MVC.Http

(source)

Definitions

data Method : Type
  HTTP methods currently supported.

Totality: total
Visibility: public export
Constructors:
GET : Method
POST : Method

Hints:
Eq Method
Ord Method
Show Method
0 Header : Type
  A HTTP header is just a pair of strings.

Totality: total
Visibility: public export
data 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 : Method -> List Header -> String -> RequestBody -> Expect r -> Maybe Bits32 -> Cmd r
  Sends a HTTP request.

Converts the response to an event of type `r`.

Totality: total
Visibility: export
get : String -> Expect r -> Cmd r
  Send a GET HTTP request.

Totality: total
Visibility: export
getText : String -> (Either HTTPError String -> r) -> Cmd r
  Send a GET request, reading the response as plain text.

Totality: total
Visibility: export
getJSON : FromJSON a => String -> (Either HTTPError a -> r) -> Cmd r
  Send a GET request, decoding the result as a JSON string
and converting it to the result type `a`.

Totality: total
Visibility: export
post : String -> RequestBody -> Expect r -> Cmd r
  Send a POST request.

Totality: total
Visibility: export