All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cpp-tizen-client.netclient-header.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
#ifndef _NetClient_H_
#define _NetClient_H_

#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 

using namespace std;

typedef enum {
	{{prefix}}_ERROR_NONE = 0, /**< Successful */
	{{prefix}}_ERROR_UNKNOWN, /**< Unknown error */
	{{prefix}}_ERROR_NO_RESPONSE_BODY, /**< No response body error */
	{{prefix}}_ERROR_JSON_PARSING_FAIL, /**< Parsing fail of json data */
	{{prefix}}_ERROR_UNREACHED_TO_SERVER, /**< Unreached to artik cloud server */
	{{prefix}}_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
	{{prefix}}_ERROR_PERMISSION_DENIED /**< Permission denied */
} {{prefix}}_error_e;

typedef enum {
	NET_HTTP_GET = 0,
	NET_HTTP_POST,
	NET_HTTP_PUT,
	NET_HTTP_DELETE,
	NET_HTTP_HEAD,
	NET_HTTP_TRACE,
	NET_HTTP_OPTIONS,
	NET_HTTP_CONNECT,
	NET_HTTP_PATCH
} NetHttpMethod;

struct MemoryStruct_s {
	char *memory;
	size_t size;
};

class NetClient {
public:
	NetClient();
	virtual ~NetClient();

	static int easycurl(string host, string path, string method, map queryParams,
		string mBody, struct curl_slist* headerList, MemoryStruct_s* p_chunk, long* code, char* errormsg);

};
#endif /* NetClient_H_ */




© 2015 - 2024 Weber Informatics LLC | Privacy Policy