|
NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
|
HTTP客户端响应结构 更多...
#include <http_client_message.hpp>
Public 成员函数 | |
| string_view | header (const string &key) const |
| 获取第一个响应头值 | |
| const vector< string > & | headers_all (const string &key) const |
| 获取所有同名响应头值 | |
| bool | has_header (const string &key) const |
| 检查响应头是否存在 | |
| bool | is_success () const noexcept |
| 检查是否为成功响应(2xx) | |
| bool | is_redirect () const noexcept |
| 检查是否为重定向响应(3xx) | |
| bool | is_client_error () const noexcept |
| 检查是否为客户端错误响应(4xx) | |
| bool | is_server_error () const noexcept |
| 检查是否为服务器错误响应(5xx) | |
| string_view | content_type () const |
| 获取Content-Type | |
Public 属性 | |
| uint16_t | http_version_major = 1 |
| HTTP主版本号 | |
| uint16_t | http_version_minor = 1 |
| HTTP次版本号 | |
| bool | chunked = false |
| 是否使用分块传输编码 | |
| uint64_t | content_length = 0 |
| Content-Length值 | |
| string | effective_url |
| 最终请求的URL | |
| int | redirect_count = 0 |
| 重定向次数 | |
| milliseconds | total_time {0} |
| 总耗时 | |
| milliseconds | connect_time {0} |
| 连接建立耗时 | |
| milliseconds | send_time {0} |
| 发送请求耗时 | |
| milliseconds | receive_time {0} |
| 接收响应耗时 | |
| http_status | status = http_status::S2_OK |
| HTTP状态码 | |
| string | status_message |
| 状态消息 | |
| unordered_map< string, vector< string > > | headers |
| 响应头 | |
| string | body |
| 响应正文 | |
| vector< http_cookie > | cookies |
| 解析后的Cookie | |
|
inlinenodiscard |
|
inlinenodiscard |
|
inlinenodiscard |
获取第一个响应头值
| key | 头名称 |
在文件 http_client_message.hpp 第 62 行定义.
引用了 headers.
被这些函数引用 content_type().
|
inlinenodiscard |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |