Singleton that handles asynchronous http requests. More...
Public Member Functions | |
void | enableCookies (const char *cookieFile) |
Enable cookie support. More... | |
var | enableCookies ( var cookieFile) |
Enable cookie support. More... | |
const std::string & | getCookieFilename () |
Get the cookie filename. More... | |
var | getCookieFilename () |
Get the cookie filename. More... | |
void | setSSLVerification (const std::string &caFile) |
Set root certificate path for SSL verification. More... | |
const std::string & | getSSLVerification () |
Get the ssl CA filename. More... | |
void | send (HttpRequest *request) |
Add a get request to task queue. More... | |
void | sendImmediate (HttpRequest *request) |
Immediate send a request. More... | |
var | sendImmediate ( var request) |
Immediate send a request. More... | |
void | setTimeoutForConnect (int value) |
Set the timeout value for connecting. More... | |
var | setTimeoutForConnect ( var value) |
Set the timeout value for connecting. More... | |
int | getTimeoutForConnect () |
Get the timeout value for connecting. More... | |
var | getTimeoutForConnect () |
Get the timeout value for connecting. More... | |
void | setTimeoutForRead (int value) |
Set the timeout value for reading. More... | |
var | setTimeoutForRead ( var value) |
Set the timeout value for reading. More... | |
int | getTimeoutForRead () |
Get the timeout value for reading. More... | |
var | getTimeoutForRead () |
Get the timeout value for reading. More... | |
Static Public Member Functions | |
static HttpClient * | getInstance () |
Get instance of HttpClient. More... | |
static void | destroyInstance () |
Release the instance of HttpClient. | |
Static Public Attributes | |
static const int | RESPONSE_BUFFER_SIZE = 256 |
The buffer size of _responseMessage. | |
var | RESPONSE_BUFFER_SIZE = 256 |
The buffer size of _responseMessage. | |
Singleton that handles asynchronous http requests.
Once the request completed, a callback will issued in main thread when it provided during make request.
|
static |
Get instance of HttpClient.
|
static |
Get instance of HttpClient.
void enableCookies | ( | const char * | cookieFile | ) |
Enable cookie support.
cookieFile | the filepath of cookie file. |
var enableCookies | ( | var | cookieFile | ) |
Enable cookie support.
cookieFile | the filepath of cookie file. |
const std::string& getCookieFilename |
( | ) |
Get the cookie filename.
var getCookieFilename | ( | ) |
Get the cookie filename.
void setSSLVerification | ( | const std::string & | caFile | ) |
Set root certificate path for SSL verification.
caFile | a full path of root certificate.if it is empty, SSL verification is disabled. |
var setSSLVerification | ( | var | caFile | ) |
Set root certificate path for SSL verification.
caFile | a full path of root certificate.if it is empty, SSL verification is disabled. |
const std::string& getSSLVerification |
( | ) |
Get the ssl CA filename.
var getSSLVerification | ( | ) |
Get the ssl CA filename.
void send | ( | HttpRequest * | request | ) |
Add a get request to task queue.
request | a HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "send" here. |
var send | ( | var | request | ) |
Add a get request to task queue.
request | a HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "send" here. |
void sendImmediate | ( | HttpRequest * | request | ) |
Immediate send a request.
request | a HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "sendImmediate" here. |
var sendImmediate | ( | var | request | ) |
Immediate send a request.
request | a HttpRequest object, which includes url, response callback etc. please make sure request->_requestData is clear before calling "sendImmediate" here. |
void setTimeoutForConnect | ( | int | value | ) |
Set the timeout value for connecting.
value | the timeout value for connecting. |
var setTimeoutForConnect | ( | var | value | ) |
Set the timeout value for connecting.
value | the timeout value for connecting. |
int getTimeoutForConnect | ( | ) |
Get the timeout value for connecting.
var getTimeoutForConnect | ( | ) |
Get the timeout value for connecting.
void setTimeoutForRead | ( | int | value | ) |
Set the timeout value for reading.
value | the timeout value for reading. |
var setTimeoutForRead | ( | var | value | ) |
Set the timeout value for reading.
value | the timeout value for reading. |
int getTimeoutForRead | ( | ) |
Get the timeout value for reading.
var getTimeoutForRead | ( | ) |
Get the timeout value for reading.