Curl Client Lib
Detailed Description
Example1. Post Request.
Example2. Get Request.
Function Documentation
const std::string CurlClient::callGet |
( |
|
) |
[inherited] |
Make 'get' request
- Returns:
- server's respose
const std::string CurlClient::callPost |
( |
const std::string & |
postData |
) |
[inherited] |
Make 'post' request
- Returns:
- server's response
void CurlClient::clearHeaders |
( |
|
) |
[inline, inherited] |
const std::string CurlClient::downloadFromFTP |
( |
void |
|
) |
[inherited] |
Download file from FTP server
- Returns:
- server's response (file contents)
std::string CurlClient::escapeUrl |
( |
const std::string & |
url |
) |
[inherited] |
Escape URL This function will convert the given input string to an URL encoded string and return that as a new allocated string. All input characters that are not a-z, A-Z or 0-9 will be converted to their "URL escaped" version (NN where NN is a two-digit hexadecimal number).
const std::string CurlClient::getErrorBuffer |
( |
|
) |
const [inline, inherited] |
const int CurlClient::getErrorCode |
( |
|
) |
const [inline, inherited] |
const std::string CurlClient::getFullErrorMessage |
( |
void |
|
) |
const [inherited] |
This function returns message with full error description Error message contains error code and error message
- Parameters:
-
- Returns:
- none
- See also:
- CurlClient::checkResultThrow
int CurlClient::getHttpStatus |
( |
|
) |
[inline, inherited] |
std::string CurlClient::getResultHeader |
( |
|
) |
[inline, inherited] |
Get Header
- Returns:
- header
void CurlClient::setClientCert |
( |
const std::string & |
cert |
) |
[inline, inherited] |
Set Client Cert
- Parameters:
-
void CurlClient::setClientCertType |
( |
const std::string & |
type |
) |
[inline, inherited] |
Set Client Cert Type
- Parameters:
-
| type | - type of certificate |
void CurlClient::setClientKey |
( |
const std::string & |
key |
) |
[inline, inherited] |
Set Client Key
- Parameters:
-
| key | string should be the file name of your private key. |
void CurlClient::setClientKeyType |
( |
const std::string & |
type |
) |
[inline, inherited] |
- Parameters:
-
| type | is a string, that should be the format of your private key. Supported formats are "PEM", "DER" and "ENG". |
void CurlClient::setConnectTimeOut |
( |
int |
iConnectTimeOut |
) |
[inline, inherited] |
Set Connection Time out
- Parameters:
-
| iConnectTimeOut | - seconds that curl client will wait server's response on connection request |
void CurlClient::setContentType |
( |
const std::string & |
sContentType |
) |
[inline, inherited] |
Set Content Type
- Parameters:
-
| sContentType | - string (e.g. "text/xml") |
void CurlClient::setHeader |
( |
const std::string & |
sHeader |
) |
[inline, inherited] |
void CurlClient::setHttpAuth |
( |
const std::string & |
s_username, |
|
|
const std::string & |
s_password | |
|
) |
| | [inline, inherited] |
Set login and password for HTTP(S) authorization
- Parameters:
-
| s_username | string - username. |
| s_password | string - password. |
void CurlClient::setTimeOut |
( |
int |
iTimeOut |
) |
[inline, inherited] |
Set Time out
- Parameters:
-
| iTimeOut | - seconds that curl client will wait server's response on not connection request |
void CurlClient::setUseSSLv3 |
( |
|
) |
[inline, inherited] |
Set using SSLv3 instead of TLSv1
std::string CurlClient::unescapeUrl |
( |
const std::string & |
url |
) |
[inherited] |
This function will convert the given URL encoded input string to a "plain string" and return that as a new allocated string. All input characters that are URL encoded (XX where XX is a two-digit hexadecimal number) will be converted to their plain text versions.
- Parameters:
-
- Returns:
- unescaped url
- See also:
- CurlClient::escapeUrl
void CurlClient::uploadToFTP |
( |
std::stringstream & |
in |
) |
[inherited] |
Upload file to FTP server