2012-08-09 10:45:11 +08:00
|
|
|
#ifndef __HTTP_CLIENT_H__
|
|
|
|
#define __HTTP_CLIENT_H__
|
|
|
|
|
|
|
|
#include "cocos2d.h"
|
|
|
|
#include "cocos-ext.h"
|
|
|
|
|
|
|
|
class HttpClientTest : public cocos2d::CCLayer
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
HttpClientTest();
|
|
|
|
virtual ~HttpClientTest();
|
|
|
|
void toExtensionsMainLayer(cocos2d::CCObject *sender);
|
|
|
|
|
|
|
|
//Menu Callbacks
|
|
|
|
void onMenuGetTestClicked(cocos2d::CCObject *sender);
|
|
|
|
void onMenuPostTestClicked(cocos2d::CCObject *sender);
|
|
|
|
void onMenuPostBinaryTestClicked(cocos2d::CCObject *sender);
|
2013-04-22 00:23:27 +08:00
|
|
|
void onMenuPutTestClicked(cocos2d::CCObject *sender);
|
|
|
|
void onMenuDeleteTestClicked(cocos2d::CCObject *sender);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
//Http Response Callback
|
2013-04-28 22:42:31 +08:00
|
|
|
void onHttpRequestCompleted(cocos2d::extension::CCHttpClient *sender, cocos2d::extension::CCHttpResponse *response);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
private:
|
2013-06-15 14:03:30 +08:00
|
|
|
cocos2d::CCLabelTTF* _labelStatusCode;
|
2012-08-09 10:45:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void runHttpClientTest();
|
|
|
|
|
|
|
|
#endif //__HTTPREQUESTHTTP_H
|