2012-08-09 10:45:11 +08:00
|
|
|
#ifndef __HTTP_CLIENT_H__
|
|
|
|
#define __HTTP_CLIENT_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
2013-10-16 16:48:39 +08:00
|
|
|
#include "extensions/cocos-ext.h"
|
|
|
|
#include "network/HttpClient.h"
|
2012-08-09 10:45:11 +08:00
|
|
|
|
2013-06-20 14:17:10 +08:00
|
|
|
class HttpClientTest : public cocos2d::Layer
|
2012-08-09 10:45:11 +08:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
HttpClientTest();
|
|
|
|
virtual ~HttpClientTest();
|
2013-06-20 14:17:10 +08:00
|
|
|
void toExtensionsMainLayer(cocos2d::Object *sender);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
//Menu Callbacks
|
2013-06-20 14:17:10 +08:00
|
|
|
void onMenuGetTestClicked(cocos2d::Object *sender);
|
|
|
|
void onMenuPostTestClicked(cocos2d::Object *sender);
|
|
|
|
void onMenuPostBinaryTestClicked(cocos2d::Object *sender);
|
|
|
|
void onMenuPutTestClicked(cocos2d::Object *sender);
|
|
|
|
void onMenuDeleteTestClicked(cocos2d::Object *sender);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
//Http Response Callback
|
2014-01-02 16:25:35 +08:00
|
|
|
void onHttpRequestCompleted(cocos2d::network::HttpClient *sender, cocos2d::network::HttpResponse *response);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-20 14:17:10 +08:00
|
|
|
cocos2d::LabelTTF* _labelStatusCode;
|
2012-08-09 10:45:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void runHttpClientTest();
|
|
|
|
|
|
|
|
#endif //__HTTPREQUESTHTTP_H
|