#pragma once

#include "IBaseCurl.h"
#include <cpr/cpr.h>
class CNetWork : public IBaseCurl
{
public:
	CNetWork();
	~CNetWork(void);


	HTTPRET PostLogin(LPCSTR username, LPCSTR password, std::string& data);
	void SetUrl(LPCSTR url);

	SStringA  GetLastErrorA();
	SStringW  GetLastErrorW();

	bool Download(std::string path);


private:
	std::string GetUrl(std::string path, std::vector<cpr::Parameter> parame);
	std::string PostUrl(std::string path, std::vector<cpr::Pair> parame);

	 
	void Init();
	void UnInit();
private:

	std::vector<std::string> vectorBaseurl;

	std::unordered_map<std::string, std::string> keymap;

	std::string m_error_msg;

	HTTPRET m_http_ret;

	int m_http_status;

	std::string m_url;

};

