|
| static void | set_mode (std::shared_ptr< http_parm > &ahttp, ENUM_MODE aval) |
| | 设置HTTP模式(HTTP/HTTPS)
|
| static void | set_type (std::shared_ptr< http_parm > &ahttp, ENUM_TYPE aval) |
| | 设置请求类型(GET/POST)
|
| static void | set_tls_verification (std::shared_ptr< http_parm > &ahttp, bool averify_peer, long averify_host=2L) |
| | 设置TLS证书验证选项
|
| static void | set_url (std::shared_ptr< http_parm > &ahttp, const std::string &aurl) |
| | 设置请求URL(字符串版本)
|
| static void | set_url (std::shared_ptr< http_parm > &ahttp, const char *aurl) |
| | 设置请求URL(C字符串版本)
|
| static void | set_param (std::shared_ptr< http_parm > &ahttp, const std::string &aparam) |
| | 设置请求参数
|
| static void | set_headers (std::shared_ptr< http_parm > &ahttp, const std::vector< std::string > &aheaders) |
| | 设置请求头
|
| static void | set_callback (std::shared_ptr< http_parm > &ahttp, const std::function< void(int, http_parm &)> &aback) |
| | 设置响应回调函数
|
|
template<typename T> |
| static void | param (std::string &aparam, const char *akey, const T &aval) |
|
template<typename ... TARGS, std::size_t... INDEX> |
| static void | param (std::string &aparam, std::index_sequence< INDEX... >, const std::array< const char *, sizeof...(TARGS)> &akeys, const TARGS &... aargs) |
|
template<typename ... TARGS> |
| static void | param (std::string &aparam, const std::array< const char *, sizeof...(TARGS)> &akeys, const TARGS &... aargs) |
| static void | send (std::shared_ptr< http_parm > &adata) |
| | 提交HTTP请求到工作队列
|
| static std::shared_ptr< http_parm > | http () |
| | 创建HTTP请求参数对象
|
| static std::shared_ptr< mail_param > | mail () |
| | 创建邮件参数对象
|
| static void | sendemail (std::shared_ptr< mail_param > &aparm) |
| | 同步发送邮件
|
HTTP客户端管理类(单例)。
提供异步HTTP请求和邮件发送功能。通过后台工作队列执行阻塞的libcurl操作, 避免阻塞主线程。使用单例模式管理全局HTTP客户端实例。
- Note
- 所有方法均为静态方法,通过curl::instance()获取内部单例。