Value object representing a URI.
This interface is meant to represent URIs according to RFC 3986 and to
provide methods for most common operations. Additional functionality for
working with URIs can be provided on top of the interface or externally.
Its primary use is for HTTP requests, but may also be used in other
contexts.
Instances of this interface are considered immutable; all methods that
might change state MUST be implemented such that they retain the internal
state of the current instance and return an instance that contains the
changed state.
Typically the Host header will be also be present in the request message.
For server-side requests, the scheme will typically be discoverable in the
server parameters.
-
link
http:
//tools. (the URI specification)ietf. org/html/rfc3986
-
Implements
Stringable
Methods |
public
abstract
__toString
() :
string
Return the string representation as a URI reference. Depending on which components of the URI are present, the resulting
|
public
abstract
getAuthority
() Retrieve the authority component of the URI. If no authority information is present, this method MUST return an empty The authority syntax of the URI is: [user-info@]host[:port] If the port component is not set or is the standard port for the current
|
public
abstract
getFragment
() Retrieve the fragment component of the URI. If no fragment is present, this method MUST return an empty string. The leading "#" character is not part of the fragment and MUST NOT be The value returned MUST be percent-encoded, but MUST NOT double-encode
|
public
abstract
getHost
() Retrieve the host component of the URI. If no host is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986
|
public
abstract
getPath
() Retrieve the path component of the URI. The path can either be empty or absolute (starting with a slash) or Normally, the empty path "" and absolute path "/" are considered equal as The value returned MUST be percent-encoded, but MUST NOT double-encode As an example, if the value should include a slash ("/") not intended as
|
public
abstract
getPort
() Retrieve the port component of the URI. If a port is present, and it is non-standard for the current scheme, If no port is present, and no scheme is present, this method MUST return If no port is present, but a scheme is present, this method MAY return
|
public
abstract
getQuery
() Retrieve the query string of the URI. If no query string is present, this method MUST return an empty string. The leading "?" character is not part of the query and MUST NOT be The value returned MUST be percent-encoded, but MUST NOT double-encode As an example, if a value in a key/value pair of the query string should
|
public
abstract
getScheme
() Retrieve the scheme component of the URI. If no scheme is present, this method MUST return an empty string. The value returned MUST be normalized to lowercase, per RFC 3986 The trailing ":" character is not part of the scheme and MUST NOT be
|
public
abstract
getUserInfo
() Retrieve the user information component of the URI. If no user information is present, this method MUST return an empty If a user is present in the URI, this will return that value; The trailing "@" character is not part of the user information and MUST
|
public
abstract
withFragment
(
$fragment
) Return an instance with the specified URI fragment. This method MUST retain the state of the current instance, and return Users can provide both encoded and decoded fragment characters. An empty fragment value is equivalent to removing the fragment.
|
public
abstract
withHost
(
$host
) Return an instance with the specified host. This method MUST retain the state of the current instance, and return An empty host value is equivalent to removing the host.
|
public
abstract
withPath
(
$path
) Return an instance with the specified path. This method MUST retain the state of the current instance, and return The path can either be empty or absolute (starting with a slash) or If the path is intended to be domain-relative rather than path relative then Users can provide both encoded and decoded path characters.
|
public
abstract
withPort
(
$port
) Return an instance with the specified port. This method MUST retain the state of the current instance, and return Implementations MUST raise an exception for ports outside the A null value provided for the port is equivalent to removing the port
|
public
abstract
withQuery
(
$query
) Return an instance with the specified query string. This method MUST retain the state of the current instance, and return Users can provide both encoded and decoded query characters. An empty query string value is equivalent to removing the query string.
|
public
abstract
withScheme
(
$scheme
) Return an instance with the specified scheme. This method MUST retain the state of the current instance, and return Implementations MUST support the schemes "http" and "https" case An empty scheme is equivalent to removing the scheme.
|
public
abstract
withUserInfo
(
$user
,
$password
=
NULL
) Return an instance with the specified user information. This method MUST retain the state of the current instance, and return Password is optional, but the user information MUST include the
|