共用方式為


WebOperationContext.OutgoingRequest 屬性

定義

取得傳送之要求的 Web 要求內容。

public:
 property System::ServiceModel::Web::OutgoingWebRequestContext ^ OutgoingRequest { System::ServiceModel::Web::OutgoingWebRequestContext ^ get(); };
public System.ServiceModel.Web.OutgoingWebRequestContext OutgoingRequest { get; }
member this.OutgoingRequest : System.ServiceModel.Web.OutgoingWebRequestContext
Public ReadOnly Property OutgoingRequest As OutgoingWebRequestContext

屬性值

OutgoingWebRequestContext 執行個體。

範例

下列程式碼會示範如何設定方法和內容型別,以及如何將標頭加入至傳出要求。

WebOperationContext.Current.OutgoingRequest.Headers.Add("Slug", "title");
WebOperationContext.Current.OutgoingRequest.Method = "GET";
WebOperationContext.Current.OutgoingRequest.ContentType = "application/octet-stream";
WebOperationContext.Current.OutgoingRequest.Headers.Add("Slug", "title")
WebOperationContext.Current.OutgoingRequest.Method = "GET"
WebOperationContext.Current.OutgoingRequest.ContentType = "application/octet-stream"

適用於