-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRestClient.h
More file actions
25 lines (20 loc) · 982 Bytes
/
RestClient.h
File metadata and controls
25 lines (20 loc) · 982 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#ifndef __okeya__RestClient__
#define __okeya__RestClient__
#include "network/HttpRequest.h"
#include "network/HttpClient.h"
#include <unordered_map>
using namespace cocos2d::network;
class RestClient
{
public:
typedef std::unordered_map<std::string, std::string> PostData;
static RestClient* getInstance();
static const std::string URL_PREFIX;
void get( const std::string path, const ccHttpRequestCallback callback);
void post(const std::string path, const ccHttpRequestCallback callback);
void post(const std::string& path, PostData& postData, const ccHttpRequestCallback callback);
void put(const std::string& path, PostData& postData, const ccHttpRequestCallback callback);
void destroy(const std::string& path, PostData& postData, const ccHttpRequestCallback callback);
void send(HttpRequest::Type type, const std::string& path, PostData& postData, const ccHttpRequestCallback& callback);
};
#endif /* defined(__okeya__RestClient__) */