|
2 | 2 | namespace Psr\Http\Message;
|
3 | 3 |
|
4 | 4 | /**
|
5 |
| - * Value object representing a URI. |
| 5 | + * Value object representing the request target, and typically a URI. |
6 | 6 | *
|
7 |
| - * URIs are considered immutable; all methods that might change state MUST |
8 |
| - * be implemented such that they retain the internal state of the current |
9 |
| - * instance and return a new instance that contains the changed state. |
| 7 | + * Instances of this interface are considered immutable; all methods that |
| 8 | + * might change state MUST be implemented such that they retain the internal |
| 9 | + * state of the current instance and return a new instance that contains the |
| 10 | + * changed state. |
| 11 | + * |
| 12 | + * Since this interface represents a request target per RFC 7230, the instance |
| 13 | + * can potentially omit the scheme and authority. As such, test methods exist |
| 14 | + * for determining what request target form is in use: |
| 15 | + * |
| 16 | + * - isOrigin() tests if the target is in origin-form (path + optional query |
| 17 | + * string only). |
| 18 | + * - isAbsolute() tests if the target is in absolute-form (minimally scheme + |
| 19 | + * authority). |
| 20 | + * - isAuthority() tests if the target contains the authority only. |
| 21 | + * - isAsterisk() tests if the entirety of the target is '*'. |
| 22 | + * |
| 23 | + * These target forms are included, as they are valid forms for use with an |
| 24 | + * HTTP request, and will appear without other URI segments available within |
| 25 | + * the request line. This interface models the target as it appears. |
| 26 | + * |
| 27 | + * Typically, for all forms other than absolute-form, minimally the Host header |
| 28 | + * will be also be present in the request message. For server-side requests, |
| 29 | + * the scheme will typically be discoverable in the server parameters. |
10 | 30 | *
|
11 | 31 | * @link http://tools.ietf.org/html/rfc3986 (the URI specification)
|
12 | 32 | * @link http://tools.ietf.org/html/rfc7230#section-2.7 (URIs as used in the HTTP specification)
|
|
0 commit comments