HttpClient.BaseAddress 屬性

定義

取得或設定傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。

public:
 property Uri ^ BaseAddress { Uri ^ get(); void set(Uri ^ value); };
public Uri BaseAddress { get; set; }
public Uri? BaseAddress { get; set; }
member this.BaseAddress : Uri with get, set
Public Property BaseAddress As Uri

屬性值

Uri

傳送要求時所使用之網際網路資源的統一資源識別元 (URI) 基底位址。

備註

使用相對 URI 傳送 HttpRequestMessage 時,訊息 Uri 會新增至 屬性, BaseAddress 以建立絕對 URI。

請注意,結合訊息 URI 時,會排除基底 URI 中最右邊 「/」 之後的所有字元。 請參閱 RFC 3986 統一資源識別項 (URI) 一般語法規格。

適用於