-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | High level HTTP client for Haskell -- -- A high level HTTP client with a simple API @package http-dispatch @version 0.6.2.0 -- | HTTP Types module Network.HTTP.Dispatch.Types type Url = String type Header = (ByteString, ByteString) type Headers = [Header] type Body = ByteString data HTTPRequestMethod HEAD :: HTTPRequestMethod GET :: HTTPRequestMethod POST :: HTTPRequestMethod PUT :: HTTPRequestMethod PATCH :: HTTPRequestMethod DELETE :: HTTPRequestMethod TRACE :: HTTPRequestMethod OPTIONS :: HTTPRequestMethod CONNECT :: HTTPRequestMethod data HTTPRequest HTTPRequest :: HTTPRequestMethod -> String -> [Header] -> Maybe ByteString -> HTTPRequest [reqMethod] :: HTTPRequest -> HTTPRequestMethod [reqUrl] :: HTTPRequest -> String [reqHeaders] :: HTTPRequest -> [Header] [reqBody] :: HTTPRequest -> Maybe ByteString data HTTPResponse HTTPResponse :: Int -> [Header] -> ByteString -> HTTPResponse [respStatus] :: HTTPResponse -> Int [respHeaders] :: HTTPResponse -> [Header] [respBody] :: HTTPResponse -> ByteString header :: String -> String -> Header transformHeaders :: [(String, String)] -> [Header] withHeader :: HTTPRequest -> Header -> HTTPRequest withHeaders :: HTTPRequest -> [Header] -> HTTPRequest withBody :: HTTPRequest -> ByteString -> HTTPRequest withMethod :: HTTPRequest -> HTTPRequestMethod -> HTTPRequest dropHeaderWithKey :: HTTPRequest -> ByteString -> HTTPRequest instance GHC.Show.Show Network.HTTP.Dispatch.Types.HTTPResponse instance GHC.Classes.Eq Network.HTTP.Dispatch.Types.HTTPResponse instance GHC.Show.Show Network.HTTP.Dispatch.Types.HTTPRequest instance GHC.Classes.Eq Network.HTTP.Dispatch.Types.HTTPRequest instance GHC.Show.Show Network.HTTP.Dispatch.Types.HTTPRequestMethod instance GHC.Classes.Eq Network.HTTP.Dispatch.Types.HTTPRequestMethod -- | A transformation layer between Dispatch types and http client module Network.HTTP.Dispatch.Internal.Request -- | Transforms a dispatch request into a low level http-client request toRequest :: HTTPRequest -> IO Request runRequest :: Runnable a => a -> IO HTTPResponse class Runnable a runRequest :: Runnable a => a -> IO HTTPResponse instance Network.HTTP.Dispatch.Internal.Request.Runnable Network.HTTP.Dispatch.Types.HTTPRequest -- | HTTP request generation DSL module Network.HTTP.Dispatch.Request data HTTPRequest HTTPRequest :: HTTPRequestMethod -> String -> [Header] -> Maybe ByteString -> HTTPRequest [reqMethod] :: HTTPRequest -> HTTPRequestMethod [reqUrl] :: HTTPRequest -> String [reqHeaders] :: HTTPRequest -> [Header] [reqBody] :: HTTPRequest -> Maybe ByteString data HTTPResponse HTTPResponse :: Int -> [Header] -> ByteString -> HTTPResponse [respStatus] :: HTTPResponse -> Int [respHeaders] :: HTTPResponse -> [Header] [respBody] :: HTTPResponse -> ByteString data HTTPRequestMethod HEAD :: HTTPRequestMethod GET :: HTTPRequestMethod POST :: HTTPRequestMethod PUT :: HTTPRequestMethod PATCH :: HTTPRequestMethod DELETE :: HTTPRequestMethod TRACE :: HTTPRequestMethod OPTIONS :: HTTPRequestMethod CONNECT :: HTTPRequestMethod runRequest :: Runnable a => a -> IO HTTPResponse -- | Make a raw HTTP request -- --
-- raw GET "http://google.com" [header Content-Type "application/json"] Nothing
--
-- HTTPRequest { reqMethod = GET
-- , reqUrl = "http://google.com"
-- , reqHeaders = [(Content-Type,"application/json")]
-- , reqBody = Nothing
-- }
--
rawRequest :: HTTPRequestMethod -> String -> [Header] -> Maybe ByteString -> HTTPRequest
-- | Make a simple HTTP GET request with headers
--
--
-- getRequest "http://google.com" [header Content-Type "application/json"]
--
-- HTTPRequest { reqMethod = GET
-- , reqUrl = "http://google.com"
-- , reqHeaders = [(Content-Type,"application/json")]
-- , reqBody = Nothing
-- }
--
getRequest :: String -> [Header] -> HTTPRequest
-- | Make a HTTP POST request with headers
postRequest :: Url -> Headers -> Maybe ByteString -> HTTPRequest
-- | Make a HTTP PUT request with headers
putRequest :: Url -> Headers -> Maybe ByteString -> HTTPRequest
-- | Make a HTTP PATCH request with headers
patchRequest :: Url -> Headers -> Maybe ByteString -> HTTPRequest
-- | Make a HTTP DELETE request with headers
deleteRequest :: Url -> Headers -> HTTPRequest
-- | Make a HTTP HEAD request
headRequest :: Url -> [Header] -> HTTPRequest
-- | Make a HTTP OPTIONS request
optionsRequest :: Url -> [Header] -> HTTPRequest
-- | Add query params to a request URL
--
--
-- withQueryParams (get "http://google.com") [("foo", "bar")]
--
-- HTTPRequest { reqMethod = GET
-- , reqUrl = "http://google.com?foo=bar"
-- , reqHeaders = []
-- , reqBody = Nothing
-- }
--
withQueryParams :: HTTPRequest -> [(String, String)] -> HTTPRequest
-- | HTTP header utils
module Network.HTTP.Dispatch.Headers
-- | Helper to generate Basic authentication
basicAuth :: ByteString -> ByteString -> Header
-- | A simple Haskell HTTP library
--
-- This module contains the primary user facing DSL for making requests
module Network.HTTP.Dispatch.Dispatch
-- | Constructs a HTTP request from raw components and returns a HTTP
-- response
raw :: HTTPRequestMethod -> String -> [(String, String)] -> Maybe ByteString -> IO HTTPResponse
get :: String -> [(String, String)] -> IO HTTPResponse
-- | Send a HTTP POST request
post :: String -> [(String, String)] -> Maybe ByteString -> IO HTTPResponse
put :: String -> [(String, String)] -> Maybe ByteString -> IO HTTPResponse
-- | Send a HTTP PATCH request
patch :: String -> [(String, String)] -> Maybe ByteString -> IO HTTPResponse
delete :: String -> [(String, String)] -> IO HTTPResponse