Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type Request = HTTPRequest
- data Response = Response {
- statusCode :: Int
- memory :: Memory
- newRequest :: String -> Request
- withMethod :: String -> Request -> Request
- withHeaders :: [(String, String)] -> Request -> Request
- responseMemory :: Response -> Memory
- responseByteString :: Response -> IO ByteString
- responseString :: Response -> IO String
- responseJSON :: JSON a => Response -> IO (Either String a)
- sendRequest :: Request -> Maybe ByteString -> IO Response
Documentation
type Request = HTTPRequest Source #
HTTP Request
withMethod :: String -> Request -> Request Source #
Update a Request
with the provided HTTP request method (GET, POST, PUT, DELETE, ...)
withHeaders :: [(String, String)] -> Request -> Request Source #
Update a Request
with the provided HTTP request headers
responseByteString :: Response -> IO ByteString Source #
Get the Response
body as a ByteString
sendRequest :: Request -> Maybe ByteString -> IO Response Source #
Send HTTP request with an optional request body