HttpResponseMessage.RequestMessage HttpResponseMessage.RequestMessage HttpResponseMessage.RequestMessage HttpResponseMessage.RequestMessage Property

定义

获取或设置导致此响应消息的请求消息。Gets or sets the request message which led to this response message.

public:
 property System::Net::Http::HttpRequestMessage ^ RequestMessage { System::Net::Http::HttpRequestMessage ^ get(); void set(System::Net::Http::HttpRequestMessage ^ value); };
public System.Net.Http.HttpRequestMessage RequestMessage { get; set; }
member this.RequestMessage : System.Net.Http.HttpRequestMessage with get, set
Public Property RequestMessage As HttpRequestMessage

属性值

导致此响应消息的请求消息。The request message which led to this response message.

注解

此属性设置为导致此响应消息的请求消息。This property is set to the request message which led to this response message. 如果使用HttpClient发送请求, 则此属性将指向最终响应的实际请求消息。In the case of a request sent using HttpClient, this property will point to the actual request message leading to the final response. 请注意, 这可能不是用户发送请求时提供的消息。Note that this may not be the same message the user provided when sending the request. 如果需要重新发送请求 (因为重定向或身份验证), 则通常会出现这种情况。This is typically the case if the request needs to be resent due to redirects or authentication. 此属性可用于确定实际创建响应的 URL (在重定向时很有用)。This property can be used to determine what URL actually created the response (useful in case of redirects).

适用于