STTNet 0.7.0
Loading...
Searching...
No Matches
stt::network::HttpRequestInformation Struct Reference

保存HTTP/HTTPS请求信息的结构体 More...

#include <sttnet.h>

Public Member Functions

std::string_view headerValue (std::string_view name) const noexcept
 按大小写不敏感方式读取请求头,不分配内存。
 
std::string_view bodyView () const noexcept
 统一读取 Content-Length 或 chunked 请求体。
 

Public Attributes

int fd =-1
 底层的socket套接字
 
uint64_t connection_obj_fd =0
 连接对象fd
 
std::string type
 请求类型
 
std::string locPara
 url中的路径和参数
 
std::string loc
 url中的路径
 
std::string para
 url中的参数
 
std::string header
 请求头
 
std::string body
 请求体
 
std::string body_chunked
 请求体(chunked)
 
std::unordered_map< std::string, std::any > ctx
 所需的数据仓库
 

Detailed Description

保存HTTP/HTTPS请求信息的结构体

Member Function Documentation

◆ bodyView()

std::string_view stt::network::HttpRequestInformation::bodyView ( ) const
noexcept

统一读取 Content-Length 或 chunked 请求体。

Returns
指向 bodybody_chunked 的非拥有视图。

◆ headerValue()

std::string_view stt::network::HttpRequestInformation::headerValue ( std::string_view name) const
noexcept

按大小写不敏感方式读取请求头,不分配内存。

Parameters
name不带冒号的 header 名,例如 content-type
Returns
指向当前 header 字符串的视图;不存在时返回空视图。
Warning
修改或销毁本请求后,返回的视图失效。

Member Data Documentation

◆ body

std::string stt::network::HttpRequestInformation::body

请求体

◆ body_chunked

std::string stt::network::HttpRequestInformation::body_chunked

请求体(chunked)

◆ connection_obj_fd

uint64_t stt::network::HttpRequestInformation::connection_obj_fd =0

连接对象fd

◆ ctx

std::unordered_map<std::string,std::any> stt::network::HttpRequestInformation::ctx

所需的数据仓库

◆ fd

int stt::network::HttpRequestInformation::fd =-1

底层的socket套接字

◆ header

std::string stt::network::HttpRequestInformation::header

请求头

◆ loc

std::string stt::network::HttpRequestInformation::loc

url中的路径

◆ locPara

std::string stt::network::HttpRequestInformation::locPara

url中的路径和参数

◆ para

std::string stt::network::HttpRequestInformation::para

url中的参数

◆ type

std::string stt::network::HttpRequestInformation::type

请求类型


The documentation for this struct was generated from the following file: