HttpClient.BaseAddress Property

Definition

Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.

public Uri BaseAddress { get; set; }
public Uri? BaseAddress { get; set; }

Property Value

Uri

The base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests.

Remarks

When sending a HttpRequestMessage with a relative URI, the message URI is added to the BaseAddress property to create an absolute URI.

Note that all characters after the right-most "/" in the base URI are excluded when combined with the message URI. See RFC 3986 Uniform Resource Identifier Generic Syntax specification.

Applies to