HttpWebRequest.MediaType 屬性

定義

取得或設定要求的媒體類型。

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

屬性值

要求的媒體類型。 預設值是 null

備註

屬性的值 MediaType 會影響 CharacterSet 屬性。 當您在要求中設定 MediaType 時,會從回應 Content-type HTTP 標頭中傳回的字元集清單中,選擇對應的媒體類型。

適用於