xrtHttpServerRequestRef

增加请求引用并返回原指针;请求正文仍由所属 Worker 串行推进。

xhttpserverrequest* xrtHttpServerRequestRef( xhttpserverrequest* pRequest );
参数说明
xhttpserverrequest* pRequest请求对象
返回:增加请求引用并返回原指针;请求正文仍由所属 Worker 串行推进。

示例已编译验证

/* 增加请求引用并返回原指针;请求正文仍由所属 Worker 串行推进。 */
result = xrtHttpServerRequestRef(pRequest);

xrtHttpServerRequestDestroy

释放请求引用及其实际使用的字段、Trailer 和缓冲正文。

void xrtHttpServerRequestDestroy( xhttpserverrequest* pRequest );
参数说明
xhttpserverrequest* pRequest请求对象
返回:释放请求引用及其实际使用的字段、Trailer 和缓冲正文。

示例已编译验证

xrtHttpServerRequestDestroy(pRequest);

xrtHttpServerRequestVersion

返回请求 HTTP 版本;空请求返回零。

xhttpversion xrtHttpServerRequestVersion( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回请求 HTTP 版本;空请求返回零。

示例已编译验证

/* 返回请求 HTTP 版本;空请求返回零。 */
result = xrtHttpServerRequestVersion(pRequest);

xrtHttpServerRequestMethod

返回借用的大小写敏感请求方法。

xstrview xrtHttpServerRequestMethod( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回借用的大小写敏感请求方法。

示例已编译验证

/* 返回借用的大小写敏感请求方法。 */
result = xrtHttpServerRequestMethod(pRequest);

xrtHttpServerRequestTarget

返回借用的原始 request-target。

xstrview xrtHttpServerRequestTarget( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回借用的原始 request-target。

示例已编译验证

/* 返回借用的原始 request-target。 */
result = xrtHttpServerRequestTarget(pRequest);

xrtHttpServerRequestParseTarget

解析拥有 target 的四种形式,结果借用请求快照。

bool xrtHttpServerRequestParseTarget( const xhttpserverrequest* pRequest, xhttptarget* pTarget );
参数说明
const xhttpserverrequest* pRequest请求对象
xhttptarget* pTarget目标
返回:解析拥有 target 的四种形式,结果借用请求快照。

示例已编译验证

/* 解析拥有 target 的四种形式,结果借用请求快照。 */
result = xrtHttpServerRequestParseTarget(pRequest, pTarget);

xrtHttpServerRequestAuthority

XRT_API bool xrtHttpServerRequestAuthority( const xhttpserverrequest* pRequest, xhttpauthority* pAuthority );

;
返回:XRT_API bool xrtHttpServerRequestAuthority( const xhttpserverrequest* pRequest, xhttpauthority* pAuthority );

示例已编译验证

/* XRT_API bool xrtHttpServerRequestAuthority( const xhttpserverrequest* pRequest, xhttpauthority* pAuthority ); */
result = xrtHttpServerRequestAuthority();

xrtHttpServerRequestFlags

返回连接、Expect、正文交付和完整性标志。

uint32 xrtHttpServerRequestFlags( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回连接、Expect、正文交付和完整性标志。

示例已编译验证

/* 返回连接、Expect、正文交付和完整性标志。 */
result = xrtHttpServerRequestFlags(pRequest);

xrtHttpServerRequestAcceptsTrailers

判断 HTTP/1.1 客户端是否正确声明不会丢弃响应 Trailer。

bool xrtHttpServerRequestAcceptsTrailers( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:判断 HTTP/1.1 客户端是否正确声明不会丢弃响应 Trailer。

示例已编译验证

/* 判断 HTTP/1.1 客户端是否正确声明不会丢弃响应 Trailer。 */
result = xrtHttpServerRequestAcceptsTrailers(pRequest);

xrtHttpServerRequestBodyMode

返回请求正文的唯一 HTTP/1 分帧模式。

xhttp1bodymode xrtHttpServerRequestBodyMode( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回请求正文的唯一 HTTP/1 分帧模式。

示例已编译验证

/* 返回请求正文的唯一 HTTP/1 分帧模式。 */
result = xrtHttpServerRequestBodyMode(pRequest);

xrtHttpServerRequestContentLength

返回定长正文声明长度;其他分帧模式返回零。

uint64 xrtHttpServerRequestContentLength( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回定长正文声明长度;其他分帧模式返回零。

示例已编译验证

/* 返回定长正文声明长度;其他分帧模式返回零。 */
result = xrtHttpServerRequestContentLength(pRequest);

xrtHttpServerRequestHeader

返回首个同名借用 Header;未找到返回空指针,字段名必须是有效 token。

const xhttpfield* xrtHttpServerRequestHeader( const xhttpserverrequest* pRequest, xstrview Name );
参数说明
const xhttpserverrequest* pRequest请求对象
xstrview Name名称(xstrview)
返回:返回首个同名借用 Header;未找到返回空指针,字段名必须是有效 token。

示例已编译验证

/* 返回首个同名借用 Header;未找到返回空指针,字段名必须是有效 token。 */
result = xrtHttpServerRequestHeader(pRequest, Name);

xrtHttpServerRequestHeaderCount

返回请求 Header 数量。

size_t xrtHttpServerRequestHeaderCount( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回请求 Header 数量。

示例已编译验证

/* 返回请求 Header 数量。 */
result = xrtHttpServerRequestHeaderCount(pRequest);

xrtHttpServerRequestHeaderData

返回连续只读 Header 数组;空请求或无字段返回空指针。

const xhttpfield* xrtHttpServerRequestHeaderData( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回连续只读 Header 数组;空请求或无字段返回空指针。

示例已编译验证

/* 返回连续只读 Header 数组;空请求或无字段返回空指针。 */
result = xrtHttpServerRequestHeaderData(pRequest);

xrtHttpServerRequestHeaderAt

返回指定位置的借用 Header,越界返回空指针。

const xhttpfield* xrtHttpServerRequestHeaderAt( const xhttpserverrequest* pRequest, size_t iIndex );
参数说明
const xhttpserverrequest* pRequest请求对象
size_t iIndex下标
返回:返回指定位置的借用 Header,越界返回空指针。

示例已编译验证

/* 返回指定位置的借用 Header,越界返回空指针。 */
result = xrtHttpServerRequestHeaderAt(pRequest, iIndex);

xrtHttpServerRequestAuth

解析唯一 Authorization;缺失、有效和错误分别返回 END、ITEM 和 ERROR。

xhttpnext xrtHttpServerRequestAuth( const xhttpserverrequest* pRequest, xhttpauth* pAuth );
参数说明
const xhttpserverrequest* pRequest请求对象
xhttpauth* pAuth认证对象
返回:解析唯一 Authorization;缺失、有效和错误分别返回 END、ITEM 和 ERROR。

示例已编译验证

/* 解析唯一 Authorization;缺失、有效和错误分别返回 END、ITEM 和 ERROR。 */
result = xrtHttpServerRequestAuth(pRequest, pAuth);

xrtHttpServerRequestProxyAuth

解析唯一 Proxy-Authorization;结果视图借用请求快照。

xhttpnext xrtHttpServerRequestProxyAuth( const xhttpserverrequest* pRequest, xhttpauth* pAuth );
参数说明
const xhttpserverrequest* pRequest请求对象
xhttpauth* pAuth认证对象
返回:解析唯一 Proxy-Authorization;结果视图借用请求快照。

示例已编译验证

/* 解析唯一 Proxy-Authorization;结果视图借用请求快照。 */
result = xrtHttpServerRequestProxyAuth(pRequest, pAuth);

xrtHttpServerRequestBasicAuth

XRT_API xhttpnext xrtHttpServerRequestBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic );

;
返回:XRT_API xhttpnext xrtHttpServerRequestBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic );

示例已编译验证

/* XRT_API xhttpnext xrtHttpServerRequestBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic ); */
result = xrtHttpServerRequestBasicAuth();

xrtHttpServerRequestProxyBasicAuth

XRT_API xhttpnext xrtHttpServerRequestProxyBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic );

;
返回:XRT_API xhttpnext xrtHttpServerRequestProxyBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic );

示例已编译验证

/* XRT_API xhttpnext xrtHttpServerRequestProxyBasicAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpbasicauth* pBasic ); */
result = xrtHttpServerRequestProxyBasicAuth();

xrtHttpServerRequestBearerAuth

解析唯一 Bearer Authorization,Token 借用请求快照。

xhttpnext xrtHttpServerRequestBearerAuth( const xhttpserverrequest* pRequest, xstrview* pToken );
参数说明
const xhttpserverrequest* pRequest请求对象
xstrview* pToken令牌
返回:解析唯一 Bearer Authorization,Token 借用请求快照。

示例已编译验证

/* 解析唯一 Bearer Authorization,Token 借用请求快照。 */
result = xrtHttpServerRequestBearerAuth(pRequest, pToken);

xrtHttpServerRequestProxyBearerAuth

解析唯一 Bearer Proxy-Authorization,Token 借用请求快照。

xhttpnext xrtHttpServerRequestProxyBearerAuth( const xhttpserverrequest* pRequest, xstrview* pToken );
参数说明
const xhttpserverrequest* pRequest请求对象
xstrview* pToken令牌
返回:解析唯一 Bearer Proxy-Authorization,Token 借用请求快照。

示例已编译验证

/* 解析唯一 Bearer Proxy-Authorization,Token 借用请求快照。 */
result = xrtHttpServerRequestProxyBearerAuth(pRequest, pToken);

xrtHttpServerRequestDigestAuth

解码唯一 Digest Authorization;标准值借用 Output。

xhttpnext xrtHttpServerRequestDigestAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pDigest );
参数说明
const xhttpserverrequest* pRequest请求对象
void* pOutput出:输出缓冲
size_t iCapacity容量
size_t* pSize出:大小
xhttpdigestauth* pDigest摘要
返回:解码唯一 Digest Authorization;标准值借用 Output。

示例已编译验证

/* 解码唯一 Digest Authorization;标准值借用 Output。 */
result = xrtHttpServerRequestDigestAuth(pRequest, pOutput, iCapacity, pSize, pDigest);

xrtHttpServerRequestProxyDigestAuth

解码唯一 Digest Proxy-Authorization;标准值借用 Output。

xhttpnext xrtHttpServerRequestProxyDigestAuth( const xhttpserverrequest* pRequest, void* pOutput, size_t iCapacity, size_t* pSize, xhttpdigestauth* pDigest );
参数说明
const xhttpserverrequest* pRequest请求对象
void* pOutput出:输出缓冲
size_t iCapacity容量
size_t* pSize出:大小
xhttpdigestauth* pDigest摘要
返回:解码唯一 Digest Proxy-Authorization;标准值借用 Output。

示例已编译验证

/* 解码唯一 Digest Proxy-Authorization;标准值借用 Output。 */
result = xrtHttpServerRequestProxyDigestAuth(pRequest, pOutput, iCapacity, pSize, pDigest);

xrtHttpServerRequestBody

XRT_API xbytesview xrtHttpServerRequestBody( const xhttpserverrequest* pRequest );

;
返回:XRT_API xbytesview xrtHttpServerRequestBody( const xhttpserverrequest* pRequest );

示例已编译验证

/* XRT_API xbytesview xrtHttpServerRequestBody( const xhttpserverrequest* pRequest ); */
result = xrtHttpServerRequestBody();

xrtHttpServerRequestBodyBytes

返回已经缓冲、流式交付或丢弃的正文总字节数。

uint64 xrtHttpServerRequestBodyBytes( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回已经缓冲、流式交付或丢弃的正文总字节数。

示例已编译验证

/* 返回已经缓冲、流式交付或丢弃的正文总字节数。 */
result = xrtHttpServerRequestBodyBytes(pRequest);

xrtHttpServerRequestTrailer

返回首个同名借用 Trailer;未找到返回空指针,字段名必须是有效 token。

const xhttpfield* xrtHttpServerRequestTrailer( const xhttpserverrequest* pRequest, xstrview Name );
参数说明
const xhttpserverrequest* pRequest请求对象
xstrview Name名称(xstrview)
返回:返回首个同名借用 Trailer;未找到返回空指针,字段名必须是有效 token。

示例已编译验证

/* 返回首个同名借用 Trailer;未找到返回空指针,字段名必须是有效 token。 */
result = xrtHttpServerRequestTrailer(pRequest, Name);

xrtHttpServerRequestTrailerCount

返回请求 Trailer 数量。

size_t xrtHttpServerRequestTrailerCount( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回请求 Trailer 数量。

示例已编译验证

/* 返回请求 Trailer 数量。 */
result = xrtHttpServerRequestTrailerCount(pRequest);

xrtHttpServerRequestTrailerData

返回连续只读 Trailer 数组;空请求或无字段返回空指针。

const xhttpfield* xrtHttpServerRequestTrailerData( const xhttpserverrequest* pRequest );
参数说明
const xhttpserverrequest* pRequest请求对象
返回:返回连续只读 Trailer 数组;空请求或无字段返回空指针。

示例已编译验证

/* 返回连续只读 Trailer 数组;空请求或无字段返回空指针。 */
result = xrtHttpServerRequestTrailerData(pRequest);

xrtHttpServerRequestTrailerAt

返回指定位置的借用 Trailer,越界返回空指针。

const xhttpfield* xrtHttpServerRequestTrailerAt( const xhttpserverrequest* pRequest, size_t iIndex );
参数说明
const xhttpserverrequest* pRequest请求对象
size_t iIndex下标
返回:返回指定位置的借用 Trailer,越界返回空指针。

示例已编译验证

/* 返回指定位置的借用 Trailer,越界返回空指针。 */
result = xrtHttpServerRequestTrailerAt(pRequest, iIndex);

xrtHttpServerRequestQueryParams

解析 request-target 的查询组件并创建拥有型 QueryParams。

xqueryparams* xrtHttpServerRequestQueryParams( const xhttpserverrequest* pRequest, const xqueryparamsconfig* pConfig, size_t* pErrorOffset );
参数说明
const xhttpserverrequest* pRequest请求对象
const xqueryparamsconfig* pConfig配置结构
size_t* pErrorOffsetErrorOffset 参数
返回:解析 request-target 的查询组件并创建拥有型 QueryParams。

示例已编译验证

/* 解析 request-target 的查询组件并创建拥有型 QueryParams。 */
result = xrtHttpServerRequestQueryParams(pRequest, pConfig, pErrorOffset);

xrtHttpServerRequestCookies

严格校验全部 Cookie 字段并一次写出借用项;Cookies 为空时查询总数。

bool xrtHttpServerRequestCookies( const xhttpserverrequest* pRequest, xcookiepair* pCookies, size_t iCapacity, size_t* pCount );
参数说明
const xhttpserverrequest* pRequest请求对象
xcookiepair* pCookiesCookes 参数
size_t iCapacity容量
size_t* pCount出:数量
返回:严格校验全部 Cookie 字段并一次写出借用项;Cookies 为空时查询总数。

示例已编译验证

/* 严格校验全部 Cookie 字段并一次写出借用项;Cookies 为空时查询总数。 */
result = xrtHttpServerRequestCookies(pRequest, pCookies, iCapacity, pCount);

xrtHttpServerRequestCookie

严格校验全部 Cookie 字段并返回首个同名借用项;END 或 ERROR 发布空结果。

xcookienext xrtHttpServerRequestCookie( const xhttpserverrequest* pRequest, xstrview Name, xcookiepair* pCookie );
参数说明
const xhttpserverrequest* pRequest请求对象
xstrview Name名称(xstrview)
xcookiepair* pCookieCookie
返回:严格校验全部 Cookie 字段并返回首个同名借用项;END 或 ERROR 发布空结果。

示例已编译验证

/* 严格校验全部 Cookie 字段并返回首个同名借用项;END 或 ERROR 发布空结果。 */
result = xrtHttpServerRequestCookie(pRequest, Name, pCookie);

xrtHttpServerRequestContentType

解析唯一 Content-Type;字段缺失返回 END,重复或无效返回 ERROR。

xhttpnext xrtHttpServerRequestContentType( const xhttpserverrequest* pRequest, xmediatype* pType );
参数说明
const xhttpserverrequest* pRequest请求对象
xmediatype* pType类型
返回:解析唯一 Content-Type;字段缺失返回 END,重复或无效返回 ERROR。

示例已编译验证

/* 解析唯一 Content-Type;字段缺失返回 END,重复或无效返回 ERROR。 */
result = xrtHttpServerRequestContentType(pRequest, pType);

xrtHttpServerRequestForm

校验媒体类型并把完整缓冲的 urlencoded 正文解析为 QueryParams。

xqueryparams* xrtHttpServerRequestForm( const xhttpserverrequest* pRequest, const xqueryparamsconfig* pConfig, size_t* pErrorOffset );
参数说明
const xhttpserverrequest* pRequest请求对象
const xqueryparamsconfig* pConfig配置结构
size_t* pErrorOffsetErrorOffset 参数
返回:校验媒体类型并把完整缓冲的 urlencoded 正文解析为 QueryParams。

示例已编译验证

/* 校验媒体类型并把完整缓冲的 urlencoded 正文解析为 QueryParams。 */
result = xrtHttpServerRequestForm(pRequest, pConfig, pErrorOffset);

xrtHttpServerRequestFormData

校验媒体类型并把完整缓冲的 multipart 正文解析为拥有型 FormData。

xformdata* xrtHttpServerRequestFormData( const xhttpserverrequest* pRequest, const xformdataconfig* pConfig, const xmultipartlimits* pLimits, xmultiparterrorinfo* pError );
参数说明
const xhttpserverrequest* pRequest请求对象
const xformdataconfig* pConfig配置结构
const xmultipartlimits* pLimitsLmts 参数
xmultiparterrorinfo* pError错误对象
返回:校验媒体类型并把完整缓冲的 multipart 正文解析为拥有型 FormData。

示例已编译验证

/* 校验媒体类型并把完整缓冲的 multipart 正文解析为拥有型 FormData。 */
result = xrtHttpServerRequestFormData(pRequest, pConfig, pLimits, pError);

xrtHttpReplyConfigInit

XRT_API void xrtHttpReplyConfigInit(xhttpreplyconfig* pConfig);

;
返回:XRT_API void xrtHttpReplyConfigInit(xhttpreplyconfig* pConfig);

示例已编译验证

httpreplyconfiginit obj;
xrtHttpReplyConfigInit(&obj);

xrtHttpReplyCreate

创建使用标准原因短语且正文为空的 Reply。

xhttpreply* xrtHttpReplyCreate(uint16 iStatus);
参数说明
uint16 iStatus状态码
返回:创建使用标准原因短语且正文为空的 Reply。

示例已编译验证

/* 创建使用标准原因短语且正文为空的 Reply。 */
xhandle* h = xrtHttpReplyCreate(iStatus);

xrtHttpReplyCreateWithConfig

XRT_API xhttpreply* xrtHttpReplyCreateWithConfig( uint16 iStatus, const xhttpreplyconfig* pConfig );

;
返回:XRT_API xhttpreply* xrtHttpReplyCreateWithConfig( uint16 iStatus, const xhttpreplyconfig* pConfig );

示例已编译验证

/* XRT_API xhttpreply* xrtHttpReplyCreateWithConfig( uint16 iStatus, const xhttpreplyconfig* pConfig ); */
xhandle* h = xrtHttpReplyCreateWithConfig();

xrtHttpReplyClone

XRT_API xhttpreply* xrtHttpReplyClone(const xhttpreply* pReply);

;
返回:XRT_API xhttpreply* xrtHttpReplyClone(const xhttpreply* pReply);

示例已编译验证

/* XRT_API xhttpreply* xrtHttpReplyClone(const xhttpreply* pReply); */
result = xrtHttpReplyClone();

xrtHttpReplyDestroy

销毁 Reply 及其字段、原因短语和正文引用;空指针是安全的空操作。

void xrtHttpReplyDestroy(xhttpreply* pReply);
参数说明
xhttpreply* pReply回复队列
返回:销毁 Reply 及其字段、原因短语和正文引用;空指针是安全的空操作。

示例已编译验证

xrtHttpReplyDestroy(pReply);

xrtHttpReplySetStatus

设置三位状态码,并恢复该状态的标准原因短语。

bool xrtHttpReplySetStatus( xhttpreply* pReply, uint16 iStatus );
参数说明
xhttpreply* pReply回复队列
uint16 iStatus状态码
返回:设置三位状态码,并恢复该状态的标准原因短语。

示例已编译验证

/* 设置三位状态码,并恢复该状态的标准原因短语。 */
result = xrtHttpReplySetStatus(pReply, iStatus);

xrtHttpReplyStatus

返回 Reply 状态码;空 Reply 返回零。

uint16 xrtHttpReplyStatus(const xhttpreply* pReply);
参数说明
const xhttpreply* pReply回复队列
返回:返回 Reply 状态码;空 Reply 返回零。

示例已编译验证

/* 返回 Reply 状态码;空 Reply 返回零。 */
result = xrtHttpReplyStatus(pReply);

xrtHttpReplySetReason

失败原子地设置自定义原因短语;空文本会显式写出空原因短语。

bool xrtHttpReplySetReason( xhttpreply* pReply, xstrview Reason );
参数说明
xhttpreply* pReply回复队列
xstrview Reason原因文本
返回:失败原子地设置自定义原因短语;空文本会显式写出空原因短语。

示例已编译验证

/* 失败原子地设置自定义原因短语;空文本会显式写出空原因短语。 */
result = xrtHttpReplySetReason(pReply, Reason);

xrtHttpReplyReason

返回借用的有效原因短语。

xstrview xrtHttpReplyReason(const xhttpreply* pReply);
参数说明
const xhttpreply* pReply回复队列
返回:返回借用的有效原因短语。

示例已编译验证

/* 返回借用的有效原因短语。 */
result = xrtHttpReplyReason(pReply);

xrtHttpReplyAddHeader

追加一个拥有型 Header,并保留同名字段。

bool xrtHttpReplyAddHeader( xhttpreply* pReply, xstrview Name, xstrview Value );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
xstrview Value值
返回:追加一个拥有型 Header,并保留同名字段。

示例已编译验证

/* 追加一个拥有型 Header,并保留同名字段。 */
result = xrtHttpReplyAddHeader(pReply, Name, Value);

xrtHttpReplySetHeader

设置首个同名 Header,并删除其余同名字段。

bool xrtHttpReplySetHeader( xhttpreply* pReply, xstrview Name, xstrview Value );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
xstrview Value值
返回:设置首个同名 Header,并删除其余同名字段。

示例已编译验证

/* 设置首个同名 Header,并删除其余同名字段。 */
result = xrtHttpReplySetHeader(pReply, Name, Value);

xrtHttpReplyRemoveHeader

删除全部同名 Header 并返回删除数量。

size_t xrtHttpReplyRemoveHeader( xhttpreply* pReply, xstrview Name );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
返回:删除全部同名 Header 并返回删除数量。

示例已编译验证

/* 删除全部同名 Header 并返回删除数量。 */
result = xrtHttpReplyRemoveHeader(pReply, Name);

xrtHttpReplyHeader

返回首个同名借用 Header,未找到返回空指针。

const xhttpfield* xrtHttpReplyHeader( const xhttpreply* pReply, xstrview Name );
参数说明
const xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
返回:返回首个同名借用 Header,未找到返回空指针。

示例已编译验证

/* 返回首个同名借用 Header,未找到返回空指针。 */
result = xrtHttpReplyHeader(pReply, Name);

xrtHttpReplyHeaderCount

返回 Header 数量。

size_t xrtHttpReplyHeaderCount(const xhttpreply* pReply);
参数说明
const xhttpreply* pReply回复队列
返回:返回 Header 数量。

示例已编译验证

/* 返回 Header 数量。 */
result = xrtHttpReplyHeaderCount(pReply);

xrtHttpReplyHeaderData

返回连续只读 Header 数组;空 Reply 或无字段返回空指针。

const xhttpfield* xrtHttpReplyHeaderData( const xhttpreply* pReply );
参数说明
const xhttpreply* pReply回复队列
返回:返回连续只读 Header 数组;空 Reply 或无字段返回空指针。

示例已编译验证

/* 返回连续只读 Header 数组;空 Reply 或无字段返回空指针。 */
result = xrtHttpReplyHeaderData(pReply);

xrtHttpReplyHeaderAt

返回指定位置的借用 Header,越界返回空指针。

const xhttpfield* xrtHttpReplyHeaderAt( const xhttpreply* pReply, size_t iIndex );
参数说明
const xhttpreply* pReply回复队列
size_t iIndex下标
返回:返回指定位置的借用 Header,越界返回空指针。

示例已编译验证

/* 返回指定位置的借用 Header,越界返回空指针。 */
result = xrtHttpReplyHeaderAt(pReply, iIndex);

xrtHttpReplyHeaders

XRT_API const xhttpheaders* xrtHttpReplyHeaders( const xhttpreply* pReply );

;
返回:XRT_API const xhttpheaders* xrtHttpReplyHeaders( const xhttpreply* pReply );

示例已编译验证

/* XRT_API const xhttpheaders* xrtHttpReplyHeaders( const xhttpreply* pReply ); */
result = xrtHttpReplyHeaders();

xrtHttpReplyEditHeaders

XRT_API xhttpheaders* xrtHttpReplyEditHeaders(xhttpreply* pReply);

;
返回:XRT_API xhttpheaders* xrtHttpReplyEditHeaders(xhttpreply* pReply);

示例已编译验证

/* XRT_API xhttpheaders* xrtHttpReplyEditHeaders(xhttpreply* pReply); */
result = xrtHttpReplyEditHeaders();

xrtHttpReplyAddChallenge

校验并追加一条 WWW-Authenticate challenge。

bool xrtHttpReplyAddChallenge( xhttpreply* pReply, xstrview Scheme, xstrview Data );
参数说明
xhttpreply* pReply回复队列
xstrview Scheme协议方案
xstrview Data数据内容
返回:校验并追加一条 WWW-Authenticate challenge。

示例已编译验证

/* 校验并追加一条 WWW-Authenticate challenge。 */
result = xrtHttpReplyAddChallenge(pReply, Scheme, Data);

xrtHttpReplyAddProxyChallenge

校验并追加一条 Proxy-Authenticate challenge。

bool xrtHttpReplyAddProxyChallenge( xhttpreply* pReply, xstrview Scheme, xstrview Data );
参数说明
xhttpreply* pReply回复队列
xstrview Scheme协议方案
xstrview Data数据内容
返回:校验并追加一条 Proxy-Authenticate challenge。

示例已编译验证

/* 校验并追加一条 Proxy-Authenticate challenge。 */
result = xrtHttpReplyAddProxyChallenge(pReply, Scheme, Data);

xrtHttpReplyAddBasicChallenge

追加带安全转义 realm 的 Basic WWW-Authenticate challenge。

bool xrtHttpReplyAddBasicChallenge( xhttpreply* pReply, xstrview Realm, bool bUtf8 );
参数说明
xhttpreply* pReply回复队列
xstrview Realm认证域
bool bUtf8bUtf8 参数
返回:追加带安全转义 realm 的 Basic WWW-Authenticate challenge。

示例已编译验证

/* 追加带安全转义 realm 的 Basic WWW-Authenticate challenge。 */
result = xrtHttpReplyAddBasicChallenge(pReply, Realm, bUtf8);

xrtHttpReplyAddProxyBasicChallenge

追加带安全转义 realm 的 Basic Proxy-Authenticate challenge。

bool xrtHttpReplyAddProxyBasicChallenge( xhttpreply* pReply, xstrview Realm, bool bUtf8 );
参数说明
xhttpreply* pReply回复队列
xstrview Realm认证域
bool bUtf8bUtf8 参数
返回:追加带安全转义 realm 的 Basic Proxy-Authenticate challenge。

示例已编译验证

/* 追加带安全转义 realm 的 Basic Proxy-Authenticate challenge。 */
result = xrtHttpReplyAddProxyBasicChallenge(pReply, Realm, bUtf8);

xrtHttpReplyAddBearerChallenge

校验并追加一条 Bearer WWW-Authenticate challenge。

bool xrtHttpReplyAddBearerChallenge( xhttpreply* pReply, const xhttpbearerchallenge* pChallenge );
参数说明
xhttpreply* pReply回复队列
const xhttpbearerchallenge* pChallenge挑战
返回:校验并追加一条 Bearer WWW-Authenticate challenge。

示例已编译验证

/* 校验并追加一条 Bearer WWW-Authenticate challenge。 */
result = xrtHttpReplyAddBearerChallenge(pReply, pChallenge);

xrtHttpReplyAddProxyBearerChallenge

校验并追加一条 Bearer Proxy-Authenticate challenge。

bool xrtHttpReplyAddProxyBearerChallenge( xhttpreply* pReply, const xhttpbearerchallenge* pChallenge );
参数说明
xhttpreply* pReply回复队列
const xhttpbearerchallenge* pChallenge挑战
返回:校验并追加一条 Bearer Proxy-Authenticate challenge。

示例已编译验证

/* 校验并追加一条 Bearer Proxy-Authenticate challenge。 */
result = xrtHttpReplyAddProxyBearerChallenge(pReply, pChallenge);

xrtHttpReplyAddDigestChallenge

追加一条规范 Digest WWW-Authenticate challenge。

bool xrtHttpReplyAddDigestChallenge( xhttpreply* pReply, const xhttpdigestchallenge* pChallenge );
参数说明
xhttpreply* pReply回复队列
const xhttpdigestchallenge* pChallenge挑战
返回:追加一条规范 Digest WWW-Authenticate challenge。

示例已编译验证

/* 追加一条规范 Digest WWW-Authenticate challenge。 */
result = xrtHttpReplyAddDigestChallenge(pReply, pChallenge);

xrtHttpReplyAddProxyDigestChallenge

追加一条规范 Digest Proxy-Authenticate challenge。

bool xrtHttpReplyAddProxyDigestChallenge( xhttpreply* pReply, const xhttpdigestchallenge* pChallenge );
参数说明
xhttpreply* pReply回复队列
const xhttpdigestchallenge* pChallenge挑战
返回:追加一条规范 Digest Proxy-Authenticate challenge。

示例已编译验证

/* 追加一条规范 Digest Proxy-Authenticate challenge。 */
result = xrtHttpReplyAddProxyDigestChallenge(pReply, pChallenge);

xrtHttpReplySetDigestInfo

设置唯一 Authentication-Info 字段。

bool xrtHttpReplySetDigestInfo( xhttpreply* pReply, const xhttpdigestinfo* pInfo );
参数说明
xhttpreply* pReply回复队列
const xhttpdigestinfo* pInfo上下文信息
返回:设置唯一 Authentication-Info 字段。

示例已编译验证

/* 设置唯一 Authentication-Info 字段。 */
result = xrtHttpReplySetDigestInfo(pReply, pInfo);

xrtHttpReplySetProxyDigestInfo

设置唯一 Proxy-Authentication-Info 字段。

bool xrtHttpReplySetProxyDigestInfo( xhttpreply* pReply, const xhttpdigestinfo* pInfo );
参数说明
xhttpreply* pReply回复队列
const xhttpdigestinfo* pInfo上下文信息
返回:设置唯一 Proxy-Authentication-Info 字段。

示例已编译验证

/* 设置唯一 Proxy-Authentication-Info 字段。 */
result = xrtHttpReplySetProxyDigestInfo(pReply, pInfo);

xrtHttpReplyAddTrailer

追加一个拥有型 Trailer,并保留同名字段。

bool xrtHttpReplyAddTrailer( xhttpreply* pReply, xstrview Name, xstrview Value );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
xstrview Value值
返回:追加一个拥有型 Trailer,并保留同名字段。

示例已编译验证

/* 追加一个拥有型 Trailer,并保留同名字段。 */
result = xrtHttpReplyAddTrailer(pReply, Name, Value);

xrtHttpReplySetTrailer

设置首个同名 Trailer,并删除其余同名字段。

bool xrtHttpReplySetTrailer( xhttpreply* pReply, xstrview Name, xstrview Value );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
xstrview Value值
返回:设置首个同名 Trailer,并删除其余同名字段。

示例已编译验证

/* 设置首个同名 Trailer,并删除其余同名字段。 */
result = xrtHttpReplySetTrailer(pReply, Name, Value);

xrtHttpReplyRemoveTrailer

删除全部同名 Trailer 并返回删除数量。

size_t xrtHttpReplyRemoveTrailer( xhttpreply* pReply, xstrview Name );
参数说明
xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
返回:删除全部同名 Trailer 并返回删除数量。

示例已编译验证

/* 删除全部同名 Trailer 并返回删除数量。 */
result = xrtHttpReplyRemoveTrailer(pReply, Name);

xrtHttpReplyTrailer

返回首个同名借用 Trailer,未找到返回空指针。

const xhttpfield* xrtHttpReplyTrailer( const xhttpreply* pReply, xstrview Name );
参数说明
const xhttpreply* pReply回复队列
xstrview Name名称(xstrview)
返回:返回首个同名借用 Trailer,未找到返回空指针。

示例已编译验证

/* 返回首个同名借用 Trailer,未找到返回空指针。 */
result = xrtHttpReplyTrailer(pReply, Name);

xrtHttpReplyTrailerCount

返回 Trailer 数量。

size_t xrtHttpReplyTrailerCount(const xhttpreply* pReply);
参数说明
const xhttpreply* pReply回复队列
返回:返回 Trailer 数量。

示例已编译验证

/* 返回 Trailer 数量。 */
result = xrtHttpReplyTrailerCount(pReply);

xrtHttpReplyTrailerData

返回连续只读 Trailer 数组;空 Reply 或无字段返回空指针。

const xhttpfield* xrtHttpReplyTrailerData( const xhttpreply* pReply );
参数说明
const xhttpreply* pReply回复队列
返回:返回连续只读 Trailer 数组;空 Reply 或无字段返回空指针。

示例已编译验证

/* 返回连续只读 Trailer 数组;空 Reply 或无字段返回空指针。 */
result = xrtHttpReplyTrailerData(pReply);

xrtHttpReplyTrailerAt

返回指定位置的借用 Trailer,越界返回空指针。

const xhttpfield* xrtHttpReplyTrailerAt( const xhttpreply* pReply, size_t iIndex );
参数说明
const xhttpreply* pReply回复队列
size_t iIndex下标
返回:返回指定位置的借用 Trailer,越界返回空指针。

示例已编译验证

/* 返回指定位置的借用 Trailer,越界返回空指针。 */
result = xrtHttpReplyTrailerAt(pReply, iIndex);

xrtHttpReplyTrailers

XRT_API const xhttpheaders* xrtHttpReplyTrailers( const xhttpreply* pReply );

;
返回:XRT_API const xhttpheaders* xrtHttpReplyTrailers( const xhttpreply* pReply );

示例已编译验证

/* XRT_API const xhttpheaders* xrtHttpReplyTrailers( const xhttpreply* pReply ); */
result = xrtHttpReplyTrailers();

xrtHttpReplyEditTrailers

XRT_API xhttpheaders* xrtHttpReplyEditTrailers(xhttpreply* pReply);

;
返回:XRT_API xhttpheaders* xrtHttpReplyEditTrailers(xhttpreply* pReply);

示例已编译验证

/* XRT_API xhttpheaders* xrtHttpReplyEditTrailers(xhttpreply* pReply); */
result = xrtHttpReplyEditTrailers();

xrtHttpReplySetBody

XRT_API bool xrtHttpReplySetBody( xhttpreply* pReply, xhttpbody* pBody );

;
返回:XRT_API bool xrtHttpReplySetBody( xhttpreply* pReply, xhttpbody* pBody );

示例已编译验证

/* XRT_API bool xrtHttpReplySetBody( xhttpreply* pReply, xhttpbody* pBody ); */
result = xrtHttpReplySetBody();

xrtHttpReplySetBytes

XRT_API bool xrtHttpReplySetBytes( xhttpreply* pReply, xbytesview Data, xstrview ContentType );

;
返回:XRT_API bool xrtHttpReplySetBytes( xhttpreply* pReply, xbytesview Data, xstrview ContentType );

示例已编译验证

/* XRT_API bool xrtHttpReplySetBytes( xhttpreply* pReply, xbytesview Data, xstrview ContentType ); */
result = xrtHttpReplySetBytes();

xrtHttpReplyBody

返回借用的正文对象,可能为空。

xhttpbody* xrtHttpReplyBody(const xhttpreply* pReply);
参数说明
const xhttpreply* pReply回复队列
返回:返回借用的正文对象,可能为空。

示例已编译验证

/* 返回借用的正文对象,可能为空。 */
result = xrtHttpReplyBody(pReply);