|
cocos2d-x
3.3
|
Singleton that handles asynchrounous http requests Once the request completed, a callback will issued in main thread when it provided during make request. More...
#include <HttpClient.h>
Public Member Functions | |
| void | enableCookies (const char *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) |
| Change the connect timeout. More... | |
| int | getTimeoutForConnect () |
| Get connect timeout. More... | |
| void | setTimeoutForRead (int value) |
| Change the download timeout. More... | |
| int | getTimeoutForRead () |
| Get download timeout. More... | |
Static Public Member Functions | |
| static HttpClient * | getInstance () |
| Return the shared instance. More... | |
| static void | destroyInstance () |
| Relase the shared instance. 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 shared instance.
| void enableCookies | ( | const char * | cookieFile | ) |
Enable cookie support.
|
static |
Return the shared instance.
|
inline |
Get connect timeout.
|
inline |
Get download timeout.
| 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. |
| 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. |
| 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. |
|
inline |
Change the connect timeout.
| value | The desired timeout. |
|
inline |
Change the download timeout.
| value |