Singleton that handles asynchrounous http requests. More...
#include <HttpClient.h>
Public Member Functions | |
void | enableCookies (const char *cookieFile) |
Enable cookie support. More... | |
var | enableCookies ( var cookieFile) |
Enable cookie support. More... | |
void | setSSLVerification (const std::string &caFile) |
Set root certificate path for SSL verification. More... | |
void | send (HttpRequest *request) |
Add a get request to task queue. More... | |
void | sendImmediate (HttpRequest *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 () |
Relase the instance of HttpClient. More... | |
var | destroyInstance () |
Relase the instance of HttpClient. More... | |
Singleton that handles asynchrounous http requests.
Once the request completed, a callback will issued in main thread when it provided during make request.
|
static |
Relase the instance of HttpClient.
|
static |
Relase the 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. |
|
static |
Get instance of HttpClient.
|
static |
Get instance of HttpClient.
|
inline |
Get the timeout value for connecting.
|
inline |
Get the timeout value for connecting.
|
inline |
Get the timeout value for reading.
|
inline |
Get the timeout value for reading.
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 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. |
|
inline |
Set the timeout value for connecting.
value | the timeout value for connecting. |
|
inline |
Set the timeout value for connecting.
value | the timeout value for connecting. |
|
inline |
Set the timeout value for reading.
value | the timeout value for reading. |
|
inline |
Set the timeout value for reading.
value | the timeout value for reading. |