2{-| A library for asynchronous HTTP requests. See the `WebSocket`
3library if you have very strict latency requirements.
9@docs get, post, request
18{-| The datatype for responses. Success contains only the returned message.
19Failures contain both an error code and an error message.
21data Response a = Success a | Waiting | Failure Int String
27 headers : [(String,String)]
30{-| Create a customized request. Arguments are request type (get, post, put,
31delete, etc.), target url, data, and a list of additional headers.
33request : String -> String -> String -> [(String,String)] -> Request String
36{-| Create a GET request to the given url. -}
37get : String -> Request String
38get url = Request "GET" url "" []
40{-| Create a POST request to the given url, carrying the given data. -}
41post : String -> String -> Request String
42post url body = Request "POST" url body []
44{-| Performs an HTTP request with the given requests. Produces a signal
45that carries the responses.
47send : Signal (Request a) -> Signal (Response String)
48send = Native.Http.send
50{-| Performs an HTTP GET request with the given urls. Produces a signal
51that carries the responses.
53sendGet : Signal String -> Signal (Response String)
54sendGet reqs = send (lift get reqs)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list