xrtHttpServerRequestRef
增加请求引用并返回原指针;请求正文仍由所属 Worker 串行推进。
| 参数 | 说明 |
|---|---|
| xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 增加请求引用并返回原指针;请求正文仍由所属 Worker 串行推进。 */ result = xrtHttpServerRequestRef(pRequest);
xrtHttpServerRequestDestroy
释放请求引用及其实际使用的字段、Trailer 和缓冲正文。
| 参数 | 说明 |
|---|---|
| xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
xrtHttpServerRequestDestroy(pRequest);
xrtHttpServerRequestVersion
返回请求 HTTP 版本;空请求返回零。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回请求 HTTP 版本;空请求返回零。 */ result = xrtHttpServerRequestVersion(pRequest);
xrtHttpServerRequestMethod
返回借用的大小写敏感请求方法。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回借用的大小写敏感请求方法。 */ result = xrtHttpServerRequestMethod(pRequest);
xrtHttpServerRequestTarget
返回借用的原始 request-target。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回借用的原始 request-target。 */ result = xrtHttpServerRequestTarget(pRequest);
xrtHttpServerRequestParseTarget
解析拥有 target 的四种形式,结果借用请求快照。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xhttptarget* pTarget | 目标 |
示例已编译验证
/* 解析拥有 target 的四种形式,结果借用请求快照。 */ result = xrtHttpServerRequestParseTarget(pRequest, pTarget);
xrtHttpServerRequestAuthority
XRT_API bool xrtHttpServerRequestAuthority( const xhttpserverrequest* pRequest, xhttpauthority* pAuthority );
示例已编译验证
/* XRT_API bool xrtHttpServerRequestAuthority( const xhttpserverrequest* pRequest, xhttpauthority* pAuthority ); */ result = xrtHttpServerRequestAuthority();
xrtHttpServerRequestFlags
返回连接、Expect、正文交付和完整性标志。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回连接、Expect、正文交付和完整性标志。 */ result = xrtHttpServerRequestFlags(pRequest);
xrtHttpServerRequestAcceptsTrailers
判断 HTTP/1.1 客户端是否正确声明不会丢弃响应 Trailer。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 判断 HTTP/1.1 客户端是否正确声明不会丢弃响应 Trailer。 */ result = xrtHttpServerRequestAcceptsTrailers(pRequest);
xrtHttpServerRequestBodyMode
返回请求正文的唯一 HTTP/1 分帧模式。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回请求正文的唯一 HTTP/1 分帧模式。 */ result = xrtHttpServerRequestBodyMode(pRequest);
xrtHttpServerRequestContentLength
返回定长正文声明长度;其他分帧模式返回零。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回定长正文声明长度;其他分帧模式返回零。 */ result = xrtHttpServerRequestContentLength(pRequest);
xrtHttpServerRequestHeader
返回首个同名借用 Header;未找到返回空指针,字段名必须是有效 token。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 返回首个同名借用 Header;未找到返回空指针,字段名必须是有效 token。 */ result = xrtHttpServerRequestHeader(pRequest, Name);
xrtHttpServerRequestHeaderCount
返回请求 Header 数量。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回请求 Header 数量。 */ result = xrtHttpServerRequestHeaderCount(pRequest);
xrtHttpServerRequestHeaderData
返回连续只读 Header 数组;空请求或无字段返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回连续只读 Header 数组;空请求或无字段返回空指针。 */ result = xrtHttpServerRequestHeaderData(pRequest);
xrtHttpServerRequestHeaderAt
返回指定位置的借用 Header,越界返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| size_t iIndex | 下标 |
示例已编译验证
/* 返回指定位置的借用 Header,越界返回空指针。 */ result = xrtHttpServerRequestHeaderAt(pRequest, iIndex);
xrtHttpServerRequestAuth
解析唯一 Authorization;缺失、有效和错误分别返回 END、ITEM 和 ERROR。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xhttpauth* pAuth | 认证对象 |
示例已编译验证
/* 解析唯一 Authorization;缺失、有效和错误分别返回 END、ITEM 和 ERROR。 */ result = xrtHttpServerRequestAuth(pRequest, pAuth);
xrtHttpServerRequestProxyAuth
解析唯一 Proxy-Authorization;结果视图借用请求快照。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xhttpauth* pAuth | 认证对象 |
示例已编译验证
/* 解析唯一 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 ); */ 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 ); */ result = xrtHttpServerRequestProxyBasicAuth();
xrtHttpServerRequestBearerAuth
解析唯一 Bearer Authorization,Token 借用请求快照。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xstrview* pToken | 令牌 |
示例已编译验证
/* 解析唯一 Bearer Authorization,Token 借用请求快照。 */ result = xrtHttpServerRequestBearerAuth(pRequest, pToken);
xrtHttpServerRequestProxyBearerAuth
解析唯一 Bearer Proxy-Authorization,Token 借用请求快照。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xstrview* pToken | 令牌 |
示例已编译验证
/* 解析唯一 Bearer Proxy-Authorization,Token 借用请求快照。 */ result = xrtHttpServerRequestProxyBearerAuth(pRequest, pToken);
xrtHttpServerRequestDigestAuth
解码唯一 Digest Authorization;标准值借用 Output。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
| xhttpdigestauth* pDigest | 摘要 |
示例已编译验证
/* 解码唯一 Digest Authorization;标准值借用 Output。 */ result = xrtHttpServerRequestDigestAuth(pRequest, pOutput, iCapacity, pSize, pDigest);
xrtHttpServerRequestProxyDigestAuth
解码唯一 Digest Proxy-Authorization;标准值借用 Output。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| void* pOutput | 出:输出缓冲 |
| size_t iCapacity | 容量 |
| size_t* pSize | 出:大小 |
| xhttpdigestauth* pDigest | 摘要 |
示例已编译验证
/* 解码唯一 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 ); */ result = xrtHttpServerRequestBody();
xrtHttpServerRequestBodyBytes
返回已经缓冲、流式交付或丢弃的正文总字节数。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回已经缓冲、流式交付或丢弃的正文总字节数。 */ result = xrtHttpServerRequestBodyBytes(pRequest);
xrtHttpServerRequestTrailer
返回首个同名借用 Trailer;未找到返回空指针,字段名必须是有效 token。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 返回首个同名借用 Trailer;未找到返回空指针,字段名必须是有效 token。 */ result = xrtHttpServerRequestTrailer(pRequest, Name);
xrtHttpServerRequestTrailerCount
返回请求 Trailer 数量。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回请求 Trailer 数量。 */ result = xrtHttpServerRequestTrailerCount(pRequest);
xrtHttpServerRequestTrailerData
返回连续只读 Trailer 数组;空请求或无字段返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
示例已编译验证
/* 返回连续只读 Trailer 数组;空请求或无字段返回空指针。 */ result = xrtHttpServerRequestTrailerData(pRequest);
xrtHttpServerRequestTrailerAt
返回指定位置的借用 Trailer,越界返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| size_t iIndex | 下标 |
示例已编译验证
/* 返回指定位置的借用 Trailer,越界返回空指针。 */ result = xrtHttpServerRequestTrailerAt(pRequest, iIndex);
xrtHttpServerRequestQueryParams
解析 request-target 的查询组件并创建拥有型 QueryParams。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| const xqueryparamsconfig* pConfig | 配置结构 |
| size_t* pErrorOffset | ErrorOffset 参数 |
示例已编译验证
/* 解析 request-target 的查询组件并创建拥有型 QueryParams。 */ result = xrtHttpServerRequestQueryParams(pRequest, pConfig, pErrorOffset);
xrtHttpServerRequestCookies
严格校验全部 Cookie 字段并一次写出借用项;Cookies 为空时查询总数。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xcookiepair* pCookies | Cookes 参数 |
| size_t iCapacity | 容量 |
| size_t* pCount | 出:数量 |
示例已编译验证
/* 严格校验全部 Cookie 字段并一次写出借用项;Cookies 为空时查询总数。 */ result = xrtHttpServerRequestCookies(pRequest, pCookies, iCapacity, pCount);
xrtHttpServerRequestCookie
严格校验全部 Cookie 字段并返回首个同名借用项;END 或 ERROR 发布空结果。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xstrview Name | 名称(xstrview) |
| xcookiepair* pCookie | Cookie |
示例已编译验证
/* 严格校验全部 Cookie 字段并返回首个同名借用项;END 或 ERROR 发布空结果。 */ result = xrtHttpServerRequestCookie(pRequest, Name, pCookie);
xrtHttpServerRequestContentType
解析唯一 Content-Type;字段缺失返回 END,重复或无效返回 ERROR。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| xmediatype* pType | 类型 |
示例已编译验证
/* 解析唯一 Content-Type;字段缺失返回 END,重复或无效返回 ERROR。 */ result = xrtHttpServerRequestContentType(pRequest, pType);
xrtHttpServerRequestForm
校验媒体类型并把完整缓冲的 urlencoded 正文解析为 QueryParams。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| const xqueryparamsconfig* pConfig | 配置结构 |
| size_t* pErrorOffset | ErrorOffset 参数 |
示例已编译验证
/* 校验媒体类型并把完整缓冲的 urlencoded 正文解析为 QueryParams。 */ result = xrtHttpServerRequestForm(pRequest, pConfig, pErrorOffset);
xrtHttpServerRequestFormData
校验媒体类型并把完整缓冲的 multipart 正文解析为拥有型 FormData。
| 参数 | 说明 |
|---|---|
| const xhttpserverrequest* pRequest | 请求对象 |
| const xformdataconfig* pConfig | 配置结构 |
| const xmultipartlimits* pLimits | Lmts 参数 |
| xmultiparterrorinfo* pError | 错误对象 |
示例已编译验证
/* 校验媒体类型并把完整缓冲的 multipart 正文解析为拥有型 FormData。 */ result = xrtHttpServerRequestFormData(pRequest, pConfig, pLimits, pError);
xrtHttpReplyConfigInit
XRT_API void xrtHttpReplyConfigInit(xhttpreplyconfig* pConfig);
示例已编译验证
httpreplyconfiginit obj; xrtHttpReplyConfigInit(&obj);
xrtHttpReplyCreate
创建使用标准原因短语且正文为空的 Reply。
| 参数 | 说明 |
|---|---|
| uint16 iStatus | 状态码 |
示例已编译验证
/* 创建使用标准原因短语且正文为空的 Reply。 */ xhandle* h = xrtHttpReplyCreate(iStatus);
xrtHttpReplyCreateWithConfig
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); */ result = xrtHttpReplyClone();
xrtHttpReplyDestroy
销毁 Reply 及其字段、原因短语和正文引用;空指针是安全的空操作。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
示例已编译验证
xrtHttpReplyDestroy(pReply);
xrtHttpReplySetStatus
设置三位状态码,并恢复该状态的标准原因短语。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| uint16 iStatus | 状态码 |
示例已编译验证
/* 设置三位状态码,并恢复该状态的标准原因短语。 */ result = xrtHttpReplySetStatus(pReply, iStatus);
xrtHttpReplyStatus
返回 Reply 状态码;空 Reply 返回零。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回 Reply 状态码;空 Reply 返回零。 */ result = xrtHttpReplyStatus(pReply);
xrtHttpReplySetReason
失败原子地设置自定义原因短语;空文本会显式写出空原因短语。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Reason | 原因文本 |
示例已编译验证
/* 失败原子地设置自定义原因短语;空文本会显式写出空原因短语。 */ result = xrtHttpReplySetReason(pReply, Reason);
xrtHttpReplyReason
返回借用的有效原因短语。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回借用的有效原因短语。 */ result = xrtHttpReplyReason(pReply);
xrtHttpReplyAddHeader
追加一个拥有型 Header,并保留同名字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
| xstrview Value | 值 |
示例已编译验证
/* 追加一个拥有型 Header,并保留同名字段。 */ result = xrtHttpReplyAddHeader(pReply, Name, Value);
xrtHttpReplySetHeader
设置首个同名 Header,并删除其余同名字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
| xstrview Value | 值 |
示例已编译验证
/* 设置首个同名 Header,并删除其余同名字段。 */ result = xrtHttpReplySetHeader(pReply, Name, Value);
xrtHttpReplyRemoveHeader
删除全部同名 Header 并返回删除数量。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 删除全部同名 Header 并返回删除数量。 */ result = xrtHttpReplyRemoveHeader(pReply, Name);
xrtHttpReplyHeader
返回首个同名借用 Header,未找到返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 返回首个同名借用 Header,未找到返回空指针。 */ result = xrtHttpReplyHeader(pReply, Name);
xrtHttpReplyHeaderCount
返回 Header 数量。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回 Header 数量。 */ result = xrtHttpReplyHeaderCount(pReply);
xrtHttpReplyHeaderData
返回连续只读 Header 数组;空 Reply 或无字段返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回连续只读 Header 数组;空 Reply 或无字段返回空指针。 */ result = xrtHttpReplyHeaderData(pReply);
xrtHttpReplyHeaderAt
返回指定位置的借用 Header,越界返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
| size_t iIndex | 下标 |
示例已编译验证
/* 返回指定位置的借用 Header,越界返回空指针。 */ result = xrtHttpReplyHeaderAt(pReply, iIndex);
xrtHttpReplyHeaders
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); */ result = xrtHttpReplyEditHeaders();
xrtHttpReplyAddChallenge
校验并追加一条 WWW-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Scheme | 协议方案 |
| xstrview Data | 数据内容 |
示例已编译验证
/* 校验并追加一条 WWW-Authenticate challenge。 */ result = xrtHttpReplyAddChallenge(pReply, Scheme, Data);
xrtHttpReplyAddProxyChallenge
校验并追加一条 Proxy-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Scheme | 协议方案 |
| xstrview Data | 数据内容 |
示例已编译验证
/* 校验并追加一条 Proxy-Authenticate challenge。 */ result = xrtHttpReplyAddProxyChallenge(pReply, Scheme, Data);
xrtHttpReplyAddBasicChallenge
追加带安全转义 realm 的 Basic WWW-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Realm | 认证域 |
| bool bUtf8 | bUtf8 参数 |
示例已编译验证
/* 追加带安全转义 realm 的 Basic WWW-Authenticate challenge。 */ result = xrtHttpReplyAddBasicChallenge(pReply, Realm, bUtf8);
xrtHttpReplyAddProxyBasicChallenge
追加带安全转义 realm 的 Basic Proxy-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Realm | 认证域 |
| bool bUtf8 | bUtf8 参数 |
示例已编译验证
/* 追加带安全转义 realm 的 Basic Proxy-Authenticate challenge。 */ result = xrtHttpReplyAddProxyBasicChallenge(pReply, Realm, bUtf8);
xrtHttpReplyAddBearerChallenge
校验并追加一条 Bearer WWW-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpbearerchallenge* pChallenge | 挑战 |
示例已编译验证
/* 校验并追加一条 Bearer WWW-Authenticate challenge。 */ result = xrtHttpReplyAddBearerChallenge(pReply, pChallenge);
xrtHttpReplyAddProxyBearerChallenge
校验并追加一条 Bearer Proxy-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpbearerchallenge* pChallenge | 挑战 |
示例已编译验证
/* 校验并追加一条 Bearer Proxy-Authenticate challenge。 */ result = xrtHttpReplyAddProxyBearerChallenge(pReply, pChallenge);
xrtHttpReplyAddDigestChallenge
追加一条规范 Digest WWW-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpdigestchallenge* pChallenge | 挑战 |
示例已编译验证
/* 追加一条规范 Digest WWW-Authenticate challenge。 */ result = xrtHttpReplyAddDigestChallenge(pReply, pChallenge);
xrtHttpReplyAddProxyDigestChallenge
追加一条规范 Digest Proxy-Authenticate challenge。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpdigestchallenge* pChallenge | 挑战 |
示例已编译验证
/* 追加一条规范 Digest Proxy-Authenticate challenge。 */ result = xrtHttpReplyAddProxyDigestChallenge(pReply, pChallenge);
xrtHttpReplySetDigestInfo
设置唯一 Authentication-Info 字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpdigestinfo* pInfo | 上下文信息 |
示例已编译验证
/* 设置唯一 Authentication-Info 字段。 */ result = xrtHttpReplySetDigestInfo(pReply, pInfo);
xrtHttpReplySetProxyDigestInfo
设置唯一 Proxy-Authentication-Info 字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| const xhttpdigestinfo* pInfo | 上下文信息 |
示例已编译验证
/* 设置唯一 Proxy-Authentication-Info 字段。 */ result = xrtHttpReplySetProxyDigestInfo(pReply, pInfo);
xrtHttpReplyAddTrailer
追加一个拥有型 Trailer,并保留同名字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
| xstrview Value | 值 |
示例已编译验证
/* 追加一个拥有型 Trailer,并保留同名字段。 */ result = xrtHttpReplyAddTrailer(pReply, Name, Value);
xrtHttpReplySetTrailer
设置首个同名 Trailer,并删除其余同名字段。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
| xstrview Value | 值 |
示例已编译验证
/* 设置首个同名 Trailer,并删除其余同名字段。 */ result = xrtHttpReplySetTrailer(pReply, Name, Value);
xrtHttpReplyRemoveTrailer
删除全部同名 Trailer 并返回删除数量。
| 参数 | 说明 |
|---|---|
| xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 删除全部同名 Trailer 并返回删除数量。 */ result = xrtHttpReplyRemoveTrailer(pReply, Name);
xrtHttpReplyTrailer
返回首个同名借用 Trailer,未找到返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
| xstrview Name | 名称(xstrview) |
示例已编译验证
/* 返回首个同名借用 Trailer,未找到返回空指针。 */ result = xrtHttpReplyTrailer(pReply, Name);
xrtHttpReplyTrailerCount
返回 Trailer 数量。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回 Trailer 数量。 */ result = xrtHttpReplyTrailerCount(pReply);
xrtHttpReplyTrailerData
返回连续只读 Trailer 数组;空 Reply 或无字段返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回连续只读 Trailer 数组;空 Reply 或无字段返回空指针。 */ result = xrtHttpReplyTrailerData(pReply);
xrtHttpReplyTrailerAt
返回指定位置的借用 Trailer,越界返回空指针。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
| size_t iIndex | 下标 |
示例已编译验证
/* 返回指定位置的借用 Trailer,越界返回空指针。 */ result = xrtHttpReplyTrailerAt(pReply, iIndex);
xrtHttpReplyTrailers
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); */ result = xrtHttpReplyEditTrailers();
xrtHttpReplySetBody
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 ); */ result = xrtHttpReplySetBytes();
xrtHttpReplyBody
返回借用的正文对象,可能为空。
| 参数 | 说明 |
|---|---|
| const xhttpreply* pReply | 回复队列 |
示例已编译验证
/* 返回借用的正文对象,可能为空。 */ result = xrtHttpReplyBody(pReply);