blockchain , sdchain cpp sdk and demo

Dependencies:   EthernetInterface mbed-rtos mbed uniqueCPUID

Fork of bcsdk by SDchain C Plus Plus Team

Client.h

Committer:
webmaster
Date:
2017-09-21
Revision:
8:f2a567ee3a46
Child:
10:aabd720e632c

File content as of revision 8:f2a567ee3a46:

/***********************************************************************
 * Module:  Client.h
 * Author:  Administrator
 * Modified: 2017Äê9ÔÂ4ÈÕ 11:08:02
 * Purpose: Declaration of the class Client
 * Comment: Client¶ÔÏó°üº¬¶ÔÔ¶³Ì
 *    APIÖ´ÐÐHTTPÇëÇóËùÐèµÄËùÓÐ
 *    ÐÅÏ¢¡£ ͨ³££¬Ó¦ÓóÌÐò½«¾ßÓÐÏò
 *    Á´ºËÐÄ·¢³öÇëÇóµÄ¿Í»§¶ËºÍÏòHSM
 *    ·þÎñÆ÷·¢³öÇëÇóµÄµ¥¶À¿Í»§¶Ë¡£
 ***********************************************************************/

#if !defined(__Account_Client_h)
#define __Account_Client_h

#include "define.h"
#include <stdio.h>  
#include <iostream>  
#include <string>  


using namespace std;

class Client
{
public:
	Client();
	Client(string ip, short port);
	~Client();

	void setIp(string newIp){ this->m_strIP = newIp;};
	string getIp(){return this->m_strIP;};
	void setPort(short newPort){this->m_sPort = newPort;};
	short getPort(){return this->m_sPort;};
	int http_post(const string &strIn,string &strOut);

	bool build_post_raw(const string & url,const string & content, string & post_raw);
	bool build_post_raw(const string & url, const string & host, const string & token, const string & content, string & post_raw);
	int http_post(const string & url,const string & content,string & strOut);
	int http_post_raw(const string &strIn,string &strOut);

protected:
private:
   int urlIndex;
   //list<URL> urls;
   std::string accessToken;
   //socket httpClient;
   std::string json;
   std::string version;

   string m_strIP;
   short m_sPort;
   string m_url;
   string m_host;
   string m_token;


};

#endif