本文整理汇总了C#中IWebResponseData.IsHeaderPresent方法的典型用法代码示例。如果您正苦于以下问题:C# IWebResponseData.IsHeaderPresent方法的具体用法?C# IWebResponseData.IsHeaderPresent怎么用?C# IWebResponseData.IsHeaderPresent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IWebResponseData
的用法示例。
在下文中一共展示了IWebResponseData.IsHeaderPresent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateContext
public override UnmarshallerContext CreateContext(IWebResponseData response, bool readEntireResponse, Stream stream, RequestMetrics metrics)
{
if (response.IsHeaderPresent(HeaderKeys.XAmzId2Header))
metrics.AddProperty(Metric.AmzId2, response.GetHeaderValue(HeaderKeys.XAmzId2Header));
if (response.IsHeaderPresent(HeaderKeys.XAmzCloudFrontIdHeader))
metrics.AddProperty(Metric.AmzCfId, response.GetHeaderValue(HeaderKeys.XAmzCloudFrontIdHeader));
return base.CreateContext(response, readEntireResponse, stream, metrics);
}
示例2: PostObjectResponse
public PostObjectResponse(IWebResponseData response)
{
HttpStatusCode = response.StatusCode;
ContentLength = response.ContentLength;
if (response.IsHeaderPresent(HeaderKeys.XAmzRequestIdHeader))
RequestId = response.GetHeaderValue(HeaderKeys.XAmzRequestIdHeader);
if (response.IsHeaderPresent(HeaderKeys.XAmzId2Header))
HostId = response.GetHeaderValue(HeaderKeys.XAmzId2Header);
if (response.IsHeaderPresent(HeaderKeys.XAmzVersionId))
VersionId = response.GetHeaderValue(HeaderKeys.XAmzVersionId);
}
示例3: CreateContext
public override UnmarshallerContext CreateContext(IWebResponseData response, bool readEntireResponse, Stream stream, RequestMetrics metrics)
{
if (response.IsHeaderPresent(AMZ_ID_2))
metrics.AddProperty(Metric.AmzId2, response.GetHeaderValue(AMZ_ID_2));
return base.CreateContext(response, readEntireResponse, stream, metrics);
}