Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Contains bindings to the Extism PDK HTTP interface
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)
- response :: FromBytes a => Response -> IO (Either String a)
- sendRequestWithBody :: ToBytes a => Request -> a -> IO Response
- sendRequest :: ToBytes a => Request -> Maybe a -> 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
response :: FromBytes a => Response -> IO (Either String a) Source #
Get the Response
body and decode it