extism-pdk-0.1.0.0: Extism Plugin Development Kit
Safe HaskellSafe-Inferred
LanguageHaskell2010

Extism.PDK.HTTP

Synopsis

Documentation

type Request = HTTPRequest Source #

HTTP Request

data Response Source #

HTTP Response

Constructors

Response 

Fields

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

responseMemory :: Response -> Memory Source #

Access the Memory block associated with a Response

responseJSON :: JSON a => Response -> IO (Either String a) Source #

Get the Response body as JSON

sendRequest :: Request -> Maybe ByteString -> IO Response Source #

Send HTTP request with an optional request body