HttpWebRequest.MediaType 屬性

定義

取得或設定要求的媒體類型。Gets or sets the media type of the request.

public:
 property System::String ^ MediaType { System::String ^ get(); void set(System::String ^ value); };
public string MediaType { get; set; }
member this.MediaType : string with get, set
Public Property MediaType As String

屬性值

String

要求的媒體類型。The media type of the request. 預設值是 nullThe default value is null.

備註

屬性的值 MediaType 會影響 CharacterSet 屬性。The value of the MediaType property affects the CharacterSet property. 當您在要求中設定時 MediaType ,會從回應 Content-type HTTP 標頭中傳回的字元集清單中選擇對應的媒體類型。When you set the MediaType in the request, the corresponding media type is chosen from the list of character sets returned in the response Content-type HTTP header.

適用於