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) 基底位址。

備註

傳送 HttpRequestMessage 具有相對 URI 的 時,訊息 URI 會新增至 BaseAddress 屬性,以建立絕對 URI。

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

適用於