|
10 | 10 | *
|
11 | 11 | * - Protocol version
|
12 | 12 | * - HTTP method
|
13 |
| - * - URL |
| 13 | + * - URI |
14 | 14 | * - Headers
|
15 | 15 | * - Message body
|
16 | 16 | *
|
@@ -48,81 +48,24 @@ public function withMethod($method);
|
48 | 48 | /**
|
49 | 49 | * Retrieves the absolute URI.
|
50 | 50 | *
|
51 |
| - * An absolute URI consists of minimally scheme and host, but can also |
52 |
| - * contain: |
53 |
| - * |
54 |
| - * - authentication (user/pass) if provided |
55 |
| - * - port (if non-standard) |
56 |
| - * - path (if any) |
57 |
| - * - query string (if present) |
58 |
| - * - fragment (if present) |
59 |
| - * |
60 |
| - * If either of the scheme or host are not present, this method MUST return |
61 |
| - * null. |
| 51 | + * This method MUST return a UriInterface instance. |
62 | 52 | *
|
63 | 53 | * @link http://tools.ietf.org/html/rfc3986#section-4.3
|
64 |
| - * @return string|null Returns the absolute URL as a string. The URL MUST |
65 |
| - * include the scheme and host; if the port is non-standard for the |
66 |
| - * scheme, the port MUST be included; authentication data MAY be |
67 |
| - * provided. If either host or scheme are missing, this method MUST |
68 |
| - * return null. |
| 54 | + * @return UriInterface Returns a UriInterface instance representing the |
| 55 | + * URI of the request, if any. |
69 | 56 | */
|
70 |
| - public function getAbsoluteUri(); |
| 57 | + public function getUri(); |
71 | 58 |
|
72 | 59 | /**
|
73 |
| - * Create a new instance with the provided absolute URI. |
74 |
| - * |
75 |
| - * The absolute URI MUST be a string, and MUST include the scheme and host. |
76 |
| - * |
77 |
| - * If the port is non-standard for the scheme, the port MUST be provided. |
78 |
| - * |
79 |
| - * Authentication data MAY be provided. |
80 |
| - * |
81 |
| - * Path, query string, and fragment are optional. |
82 |
| - * |
83 |
| - * When setting the absolute URI, the url (see getUrl() and setUrl()) MUST |
84 |
| - * be updated. |
| 60 | + * Create a new instance with the provided URI. |
85 | 61 | *
|
86 | 62 | * This method MUST be implemented in such a way as to retain the
|
87 | 63 | * immutability of the message, and MUST return a new instance that has the
|
88 |
| - * changed URI and updated URL. |
| 64 | + * new UriInterface instance. |
89 | 65 | *
|
90 | 66 | * @link http://tools.ietf.org/html/rfc3986#section-4.3
|
91 |
| - * @param string $uri Absolute request URI. |
92 |
| - * @return RequestInterface |
93 |
| - * @throws \InvalidArgumentException If the URI is invalid. |
94 |
| - */ |
95 |
| - public function withAbsoluteUri($uri); |
96 |
| - |
97 |
| - /** |
98 |
| - * Retrieves the request URL. |
99 |
| - * |
100 |
| - * The request URL is the path and query string ONLY. |
101 |
| - * |
102 |
| - * @link http://tools.ietf.org/html/rfc7230#section-5.3 |
103 |
| - * @return string Returns the URL as a string. The URL MUST be an |
104 |
| - * origin-form (path + query string), per RFC 7230 section 5.3 |
105 |
| - */ |
106 |
| - public function getUrl(); |
107 |
| - |
108 |
| - /** |
109 |
| - * Create a new instance with the specified request URL. |
110 |
| - * |
111 |
| - * The URL MUST be a string. The URL SHOULD be an origin-form (path + query |
112 |
| - * string) per RFC 7230 section 5.3; if other URL parts are present, the |
113 |
| - * method MUST raise an exception OR remove those parts. |
114 |
| - * |
115 |
| - * When setting the URL, the absolute URI (see getAbsoluteUri() and |
116 |
| - * setAbsoluteUri()) MUST be updated. |
117 |
| - * |
118 |
| - * This method MUST be implemented in such a way as to retain the |
119 |
| - * immutability of the message, and MUST return a new instance that has the |
120 |
| - * changed URL and updated absolute URI. |
121 |
| - * |
122 |
| - * @link http://tools.ietf.org/html/rfc7230#section-5.3 |
123 |
| - * @param string $url Request URL, with path and optionally query string. |
| 67 | + * @param UriInterface $uri New request URI to use. |
124 | 68 | * @return RequestInterface
|
125 |
| - * @throws \InvalidArgumentException If the URL is invalid. |
126 | 69 | */
|
127 |
| - public function withUrl($url); |
| 70 | + public function withUri(UriInterface $uri); |
128 | 71 | }
|
0 commit comments