lue-bird/elm-state-interface/1.0.0

NOTE: the latest version is 2.0.4

Web.Http

Helpers for HTTP types as part of an Interface

Expect the response body to be JSON, decode it using the supplied decoder.

Expect the response body to be a String.

Discard the response body.

bodyJson : Value -> HttpBody

Put some JSON value in the body of your request. This will automatically add the Content-Type: application/json header.

get :
{ url : String
, headers : List HttpHeader
, expect : HttpExpect state
, timeout : Maybe Int
}
-> HttpRequest state

Create a GET HttpRequest

{ url : String
, headers : List HttpHeader
, body : HttpBody
, expect : HttpExpect state
, timeout : Maybe Int
}
-> HttpRequest state

Create a POST HttpRequest

request : HttpRequest state -> Interface state

An Interface for handling an HttpRequest using the fetch API