2012-08-09 10:45:11 +08:00
|
|
|
#ifndef __HTTP_CLIENT_H__
|
|
|
|
#define __HTTP_CLIENT_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "cocos-ext.h"
|
|
|
|
|
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
|
2013-06-20 14:17:10 +08:00
|
|
|
void onHttpRequestCompleted(cocos2d::extension::HttpClient *sender, cocos2d::extension::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
|