elm-lang/core/1.1.1

NOTE: this package moved to elm/core

NOTE: this package is not compatible with Elm 0.19.1

Http

A library for asynchronous HTTP requests. See the WebSocket library if you have very strict latency requirements.

Sending Requests

send : Signal (Request a) -> Signal (Response String)

Performs an HTTP request with the given requests. Produces a signal that carries the responses.

sendGet : Signal String -> Signal (Response String)

Performs an HTTP GET request with the given urls. Produces a signal that carries the responses.

Creating Requests

get : String -> Request String

Create a GET request to the given url.

post : String -> String -> Request String

Create a POST request to the given url, carrying the given data.

request : String -> String -> String -> List ( String, String ) -> Request String

Create a customized request. Arguments are request type (get, post, put, delete, etc.), target url, data, and a list of additional headers.

Responses

type Response a
= Success a
| Waiting
| Failure Int String

The datatype for responses. Success contains only the returned message. Failures contain both an error code and an error message.