- module Network.Curl.Opts
- module Network.Curl.Easy
- module Network.Curl.Post
- module Network.Curl.Info
- module Network.Curl.Types
- module Network.Curl.Code
- withCurlDo :: IO a -> IO a
- setopts :: Curl -> [CurlOption] -> IO ()
- data CurlResponse = CurlResponse {
- respCurlCode :: CurlCode
- respStatus :: Int
- respStatusLine :: String
- respHeaders :: [(String, String)]
- respBody :: String
- respGetInfo :: Info -> IO InfoValue
- curlGet :: URLString -> [CurlOption] -> IO ()
- curlGetString :: URLString -> [CurlOption] -> IO (CurlCode, String)
- curlGetResponse :: URLString -> [CurlOption] -> IO CurlResponse
- curlHead :: URLString -> [CurlOption] -> IO (String, [(String, String)])
- curlMultiPost :: URLString -> [CurlOption] -> [HttpPost] -> IO ()
- curlPost :: URLString -> [String] -> IO ()
- getResponseCode :: Curl -> IO Int
- setDefaultSSLOpts :: Curl -> URLString -> IO ()
- callbackWriter :: (String -> IO ()) -> WriteFunction
- easyWriter :: (String -> IO ()) -> WriteFunction
- ignoreOutput :: WriteFunction
- gatherOutput :: IORef [String] -> WriteFunction
- method_GET :: [CurlOption]
- method_HEAD :: [CurlOption]
- method_POST :: [CurlOption]
Documentation
module Network.Curl.Opts
module Network.Curl.Easy
module Network.Curl.Post
module Network.Curl.Info
module Network.Curl.Types
module Network.Curl.Code
withCurlDo :: IO a -> IO aSource
Should be used once to wrap all uses of libcurl. WARNING: the argument should not return before it is completely done with curl (e.g., no forking or lazy returns)
data CurlResponse Source
CurlResponse
is a record type encoding all the information
embodied in a response to your Curl request. Currently only used
to gather up the results of doing a GET in curlGetResponse
.
CurlResponse | |
|
curlGet :: URLString -> [CurlOption] -> IO ()Source
curlGet
perform a basic GET, dumping the output on stdout.
The list of options are set prior performing the GET request.
curlGetString :: URLString -> [CurlOption] -> IO (CurlCode, String)Source
curlGetString
performs the same request as curlGet
, but
returns the response body as a Haskell string.
curlGetResponse :: URLString -> [CurlOption] -> IO CurlResponseSource
curlGetResponse
performs a GET, returning all the info
it can lay its hands on in the response, a value of type CurlResponse
.
curlHead :: URLString -> [CurlOption] -> IO (String, [(String, String)])Source
Get the headers associated with a particular URL. Returns the status line and the key-value pairs for the headers.
curlMultiPost :: URLString -> [CurlOption] -> [HttpPost] -> IO ()Source
curlMultiPost
perform a multi-part POST submission.
curlPost :: URLString -> [String] -> IO ()Source
curlPost
performs. a common POST operation, namely that
of submitting a sequence of name=value pairs.
getResponseCode :: Curl -> IO IntSource
callbackWriter :: (String -> IO ()) -> WriteFunctionSource
Imports data into the Haskell world and invokes the callback.
easyWriter :: (String -> IO ()) -> WriteFunctionSource
ignoreOutput :: WriteFunctionSource
The output of Curl is ignored. This function does not marshall data into Haskell.
gatherOutput :: IORef [String] -> WriteFunctionSource
Add chunks of data to an IORef as they arrive.