HttpRequestMessageExtensionMethods.ToMessage(HttpRequestMessage) 方法

定義

Message 執行個體建立 HttpRequestMessage 執行個體。Creates a Message instance from an HttpRequestMessage instance.

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

參數

httpRequestMessage
HttpRequestMessage

要從其中建立 HttpRequestMessage 執行個體的 MessageThe HttpRequestMessage from which to create the Message instance.

傳回

Message 執行個體。The new Message instance.

備註

可以讀取、寫入和複製ByteStreamMessage 實例,就像傳統實例一樣。MessageThe Message instance can be read, written and copied just as a traditional ByteStreamMessage instance. 實例也可以「讀取」, 藉由呼叫ToHttpRequestMessage擴充HttpRequestMessage方法來抓取原始實例。 MessageThe Message instance can also "read" to retrieve the original HttpRequestMessage instance by calling the ToHttpRequestMessage extension method.

適用於