fastdo  0.6.16
http_HttpCUrl.hpp
浏览该文件的文档.
1 #pragma once
2 
3 namespace http
4 {
5 
8 {
9 public:
10  HttpCUrl();
11  virtual ~HttpCUrl();
12 
16  winux::Buffer const & getResponse() const;
17 
21  char const * getResponseStr( size_t * size = NULL ) const;
22 
24  size_t getResponseSize() const;
25 
27  winux::String getResponseContentType() const;
28 
30  winux::String getResponseMime() const;
31 
33  winux::String getResponseCharset() const;
34 
36  bool get( winux::String const & url, http::Header const & headers = http::Header() );
38  bool post( winux::String const & url, winux::Mixed const & postVars = winux::mxNull, http::Header const & headers = http::Header() );
40  bool post( winux::String const & url, eiennet::PostMultipart const & multipart, http::Header const & headers = http::Header() );
42  bool post( winux::String const & url, winux::String const & contentType, winux::AnsiString const & postData, http::Header const & headers = http::Header() );
43 
44 protected:
45  // 当发生'写'动作
46  virtual size_t OnWrite( char * buf, size_t itemSize, size_t count );
47 
48 private:
49  winux::GrowBuffer _response;
50  winux::String _contentType;
51 };
52 
53 } // namespace http
XString< char > AnsiString
Definition: utilities.hpp:257
代表HTTP头部
Definition: http_Header.hpp:10
#define HTTPWRAPPER_DLL
Definition: http_base.hpp:24
Mixed const mxNull
Mixed(MT_NULL)常量对象
XString< tchar > String
Definition: utilities.hpp:261
HTTP协议的相关简单类封装
Definition: http_base.hpp:32
缓冲区,表示内存中一块二进制数据(利用malloc/realloc进行内存分配)
Definition: utilities.hpp:906
高效的可增长缓冲区,1.33倍冗余量
Definition: utilities.hpp:1103
http post请求以“multipart/formdata”方式发送数据的支持类
混合体,能表示多种类型的值
Definition: utilities.hpp:1440
CURL的HTTP协议封装,默认30秒超时
libcurl低层封装,主要提供了CURL句柄资源管理功能