xtd 0.2.0
Loading...
Searching...
No Matches

◆ absolute_path()

xtd::string xtd::uri::absolute_path ( ) const

Gets the absolute path of the URI.

Returns
The absolute path to the resource.
Exceptions
xtd::invalid_operation_exceptionThis instance represents a relative URI, and this property is valid only for absolute URIs.
Examples
The following example writes the path /catalog/shownew.htm to the console.
auto base_uri = uri("http://www.contoso.com/");
auto my_uri = uri(base_uri, "catalog/shownew.htm?date=today");
console::write_line(my_uri.absolute_path());
static void write_line()
Writes the current line terminator to the standard output stream using the specified format informati...
uri()=default
Initializes a new instance of the xtd::uri class.
Remarks
The xtd::uri::absolute_path property contains the path information that the server uses to resolve requests for information. Typically this is the path to the desired information on the server's file system, although it also can indicate the application or script the server must run to provide the information.
The path information does not include the scheme, host name, or query portion of the URI.