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();
|
2014-02-20 10:53:49 +08:00
|
|
|
void toExtensionsMainLayer(cocos2d::Ref *sender);
|
2012-08-09 10:45:11 +08:00
|
|
|
|
|
|
|
//Menu Callbacks
|
2014-06-22 00:11:20 +08:00
|
|
|
void onMenuGetTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
|
|
|
void onMenuPostTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
|
|
|
void onMenuPostBinaryTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
|
|
|
void onMenuPutTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
|
|
|
void onMenuDeleteTestClicked(cocos2d::Ref *sender, bool isImmediate);
|
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:
|
2014-03-26 23:33:58 +08:00
|
|
|
cocos2d::Label* _labelStatusCode;
|
2012-08-09 10:45:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
void runHttpClientTest();
|
|
|
|
|
|
|
|
#endif //__HTTPREQUESTHTTP_H
|