#include <librets/CurlEasy.h>
Public Member Functions | |
CurlEasy () | |
~CurlEasy () | |
void | SetVerbose (bool verbose) |
Enable verbose logging. | |
void | SetDebugData (void *debugData) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the debugging callbacks. | |
void | SetDebugFunction (curl_debug_callback debugFunction) |
Provide to cURL a reference to the method that cURL should invoke when performing the logging/debug function. | |
void | SetHttpAuth (long httpAuth) |
Indicate to cURL the authentication methodology. | |
void | SetCookieFile (std::string cookieFile) |
Indicate to cURL the name of the file to which cookies will be stored. | |
void | SetWriteData (void *writeData) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteData callbacks. | |
void | SetWriteFunction (curl_write_callback writeFunction) |
Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network. | |
void | SetWriteHeaderData (void *headerData) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteHeaderData callbacks. | |
void | SetWriteHeaderFunction (curl_write_callback headerFunction) |
Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network. | |
void | SetUserCredentials (std::string username, std::string password) |
Provide to cURL the user name and the password to be used with the selected authentication method. | |
void | SetHttpGet (bool httpGet) |
Indicate to cURL whether or not the GET or POST method should be used. | |
void | SetPostFields (std::string postFields) |
Provide to cURL a string containing the fields to be used with the POST. | |
void | SetHttpHeaders (const curl_slist *httpHeaders) |
Provide to cURL a list of headers and values to be sent as part of the http transaction. | |
void | SetUrl (std::string url) |
Provide to cURL a string containing the URL to which the http transaction will be sent. | |
void | SetProxyUrl (std::string url) |
Provide to cURL a string containing the URL of the proxy server. | |
void | SetProxyPassword (std::string password) |
Provide to cURL the proxy authentication password if required. | |
void | SetPrivateData (void *data) |
Provide to cURL a pointer to the private data associated with this request. | |
void | SetShareHandle (CURLSH *shared) |
Provide to cURL a reference to the shared object. | |
void | SetTimeout (int seconds) |
Provide to cURL an integer containing a timeout in seconds. | |
void | SetSSLVerify (bool verify) |
Tell cURL whether or not to verify SSL connections. | |
void | Perform () |
Tell cURL to perform the current request. | |
long | GetResponseCode () |
Obtain the response code from cURL for the last transaction. | |
bool | GetVerbose () |
Get the current state of the verbose/logging flag. | |
CURL * | GetEasyHandle () |
Get the current handle to the cURL "Easy" structure. | |
curl_slist * | GetCookieSlist () |
Get a pointer to the cookie list from cURL. | |
void * | GetPrivateData () |
Get the private data associated with this request. | |
std::string | GetUrl () |
Get the url. | |
std::string | GetVersion () |
Get the current curl library version information. |
CurlEasy | ( | ) |
~CurlEasy | ( | ) |
curl_slist* GetCookieSlist | ( | ) |
Get a pointer to the cookie list from cURL.
CURL* GetEasyHandle | ( | ) |
Get the current handle to the cURL "Easy" structure.
See the libCURL documentation.
void* GetPrivateData | ( | ) |
Get the private data associated with this request.
long GetResponseCode | ( | ) |
Obtain the response code from cURL for the last transaction.
Because of the use of the cURL multi-interface, it is possible for the status to be zero until the entire transaction has been satisfied. It is assumed, therefore, that when this method is called, the caller desires the transaction to be completed. This method will therefore continue the request until a non-zero response is returned by cURL.
std::string GetUrl | ( | ) |
Get the url.
bool GetVerbose | ( | ) |
Get the current state of the verbose/logging flag.
std::string GetVersion | ( | ) |
Get the current curl library version information.
void Perform | ( | ) |
Tell cURL to perform the current request.
void SetCookieFile | ( | std::string | cookieFile | ) |
Indicate to cURL the name of the file to which cookies will be stored.
cookieFile | A string containing the name of the cookie file. |
void SetDebugData | ( | void * | debugData | ) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the debugging callbacks.
debugData | A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback. |
void SetDebugFunction | ( | curl_debug_callback | debugFunction | ) |
Provide to cURL a reference to the method that cURL should invoke when performing the logging/debug function.
debugFunction | A static reference to the callback function. |
void SetHttpAuth | ( | long | httpAuth | ) |
Indicate to cURL the authentication methodology.
See the libCURL documentation.
httpAuth | The cURL authentication code. |
void SetHttpGet | ( | bool | httpGet | ) |
Indicate to cURL whether or not the GET or POST method should be used.
httpGet | A boolean when TRUE sets the GET method; when FALSE set the POST method. |
void SetHttpHeaders | ( | const curl_slist * | httpHeaders | ) |
Provide to cURL a list of headers and values to be sent as part of the http transaction.
httpHeaders | A list of headers. See the libCURL documentation. |
void SetPostFields | ( | std::string | postFields | ) |
Provide to cURL a string containing the fields to be used with the POST.
postFields | A string containg the fields to be used with the POST. |
void SetPrivateData | ( | void * | data | ) |
Provide to cURL a pointer to the private data associated with this request.
data | A pointer to the private data. |
void SetProxyPassword | ( | std::string | password | ) |
Provide to cURL the proxy authentication password if required.
password | A string containing the proxy password. |
void SetProxyUrl | ( | std::string | url | ) |
Provide to cURL a string containing the URL of the proxy server.
The URL should include the proxy port.
url | A string containing the proxy URL. |
void SetShareHandle | ( | CURLSH * | shared | ) |
Provide to cURL a reference to the shared object.
shared | A pointer to a CURLSH handle. |
void SetSSLVerify | ( | bool | verify | ) |
Tell cURL whether or not to verify SSL connections.
verify | A boolean that if TRUE (default), indicates that the connection should be verified. |
void SetTimeout | ( | int | seconds | ) |
Provide to cURL an integer containing a timeout in seconds.
seconds | An integer containing the number of seconds to establish as a timeout. |
void SetUrl | ( | std::string | url | ) |
Provide to cURL a string containing the URL to which the http transaction will be sent.
url | A string containing a URL. |
void SetUserCredentials | ( | std::string | username, | |
std::string | password | |||
) |
Provide to cURL the user name and the password to be used with the selected authentication method.
username | A string containing the user name. | |
password | A string containing the password. |
void SetVerbose | ( | bool | verbose | ) |
Enable verbose logging.
verbose | TRUE to enable logging, FALSE to disable it. |
void SetWriteData | ( | void * | writeData | ) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteData callbacks.
writeData | A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback. |
void SetWriteFunction | ( | curl_write_callback | writeFunction | ) |
Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.
writeFunction | A static reference to the callback function. |
void SetWriteHeaderData | ( | void * | headerData | ) |
Provide to cURL a pointer to the opaque data that cURL in turn will use for the WriteHeaderData callbacks.
headerData | A pointer to the opaque data to be given to cURL. Typically this is the "this" pointer for the class implementing the callback. |
void SetWriteHeaderFunction | ( | curl_write_callback | headerFunction | ) |
Provide to cURL a reference to the method that cURL should invoke when trying to write data it accepts from the network.
headerFunction | A static reference to the callback function. |