HttpResponseMessageExtensionMethods.ToMessage(HttpResponseMessage) HttpResponseMessageExtensionMethods.ToMessage(HttpResponseMessage) HttpResponseMessageExtensionMethods.ToMessage(HttpResponseMessage) Method

定义

通过 Message 实例创建 HttpResponseMessage 实例。Creates a Message instance from an HttpResponseMessage instance.

public:
[System::Runtime::CompilerServices::Extension]
 static System::ServiceModel::Channels::Message ^ ToMessage(System::Net::Http::HttpResponseMessage ^ httpResponseMessage);
public static System.ServiceModel.Channels.Message ToMessage (this System.Net.Http.HttpResponseMessage httpResponseMessage);
static member ToMessage : System.Net.Http.HttpResponseMessage -> System.ServiceModel.Channels.Message

参数

httpResponseMessage
HttpResponseMessage HttpResponseMessage HttpResponseMessage

从中创建 HttpResponseMessage 实例的 MessageThe HttpResponseMessage from which to create the Message instance.

返回

新的 Message 实例。The new Message instance.

注解

Message实例可以读取、 写入和复制就像在传统ByteStreamMessage实例。The Message instance can be read, written and copied just as a traditional ByteStreamMessage instance. Message实例",请参阅"检索原始HttpResponseMessage实例通过调用ToHttpResponseMessage扩展方法。The Message instance can also "read" to retrieve the original HttpResponseMessage instance by calling the ToHttpResponseMessage extension method.

适用于