123456789101112131415161718192021222324252627282930313233 |
- #pragma once
- #include <afxinet.h>
- #include <string>
- #include <vector>
- #include <boost\smart_ptr.hpp>
- using namespace std;
- #define IE_AGENT _T("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)")
- class __declspec(dllexport) CMyHttpClient
- {
- public:
- enum { SUCCESS = 0, FAILURE = 1, OUTTIME = 2 };
- public:
- CMyHttpClient(LPCTSTR strAgent = IE_AGENT);
- virtual ~CMyHttpClient(void);
- //int HttpPostFile(LPCTSTR strUrl, std::vector<CInputFiled*>& inputs, string &strResponse);
- int HttpDownload(LPCTSTR url, LPCTSTR post_data, std::vector<char> &data);
- static boost::shared_ptr<CMyHttpClient> GetInstance();
- private:
- void Clear();
- private:
- CInternetSession *m_pSession;
- CHttpConnection *m_pConnection;
- CHttpFile *m_pHttpFile;
- public:
- int SetSendHeader(CString send);
- private:
- CString MySendHeader;
- };
|