|
21 | 21 | interface RequestInterface extends MessageInterface
|
22 | 22 | {
|
23 | 23 | /**
|
24 |
| - * Retrieves the message's request line. |
| 24 | + * Retrieves the message's request target. |
25 | 25 | *
|
26 |
| - * Retrieves the message's request line either as it will appear (for |
| 26 | + * Retrieves the message's request-target either as it will appear (for |
27 | 27 | * clients), as it appeared at request (for servers), or as it was
|
28 |
| - * specified for the instance (see withRequestLine()). |
| 28 | + * specified for the instance (see withRequestTarget()). |
29 | 29 | *
|
30 |
| - * This method MUST return a string of the form: |
| 30 | + * In most cases, this will be the origin-form of the composed URI, |
| 31 | + * unless a value was provided to the concrete implementation (see |
| 32 | + * withRequestTarget() below). |
31 | 33 | *
|
32 |
| - * <code> |
33 |
| - * HTTP_METHOD REQUEST_TARGET HTTP/PROTOCOL_VERSION |
34 |
| - * </code> |
35 |
| - * |
36 |
| - * If the request line is calculated at method execution (i.e., not from |
37 |
| - * a value set on the instance), the request-target MUST be in origin-form. |
38 |
| - * |
39 |
| - * If any aspect of the request line is unknown, it MUST raise an |
40 |
| - * exception. |
| 34 | + * If no URI is available, and no request-target has been specifically |
| 35 | + * provided, this method MUST return the string "/". |
41 | 36 | *
|
42 | 37 | * @return string
|
43 |
| - * @throws \RuntimeException if unable to construct a valid request line. |
44 | 38 | */
|
45 |
| - public function getRequestLine(); |
| 39 | + public function getRequestTarget(); |
46 | 40 |
|
47 | 41 | /**
|
48 |
| - * Create a new instance with a specific request line. |
49 |
| - * |
50 |
| - * If the request needs a specific request line — for instance, to allow |
51 |
| - * specifying an absolute-form, authority-form, or asterisk-form |
52 |
| - * request-target — this method may be used to create an instance with |
53 |
| - * the specified request line, verbatim. |
54 |
| - * |
55 |
| - * This method MUST validate that the line is in the form: |
56 |
| - * |
57 |
| - * <code> |
58 |
| - * HTTP_METHOD REQUEST_TARGET HTTP/PROTOCOL_VERSION |
59 |
| - * </code> |
| 42 | + * Create a new instance with a specific request-target. |
60 | 43 | *
|
61 |
| - * and raise an exception if not. |
| 44 | + * If the request needs a non-origin-form request-target — e.g., for |
| 45 | + * specifying an absolute-form, authority-form, or asterisk-form — |
| 46 | + * this method may be used to create an instance with the specified |
| 47 | + * request-target, verbatim. |
62 | 48 | *
|
63 | 49 | * This method MUST be implemented in such a way as to retain the
|
64 | 50 | * immutability of the message, and MUST return a new instance that has the
|
65 |
| - * changed request line. |
| 51 | + * changed request target. |
66 | 52 | *
|
67 | 53 | * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various
|
68 | 54 | * request-target forms allowed in request messages)
|
69 |
| - * @param mixed $requestLine |
| 55 | + * @param mixed $requestTarget |
70 | 56 | * @return self
|
71 |
| - * @throws \InvalidArgumentException for invalid request lines. |
72 | 57 | */
|
73 |
| - public function withRequestLine($requestLine); |
| 58 | + public function withRequestTarget($requestTarget); |
74 | 59 |
|
75 | 60 | /**
|
76 | 61 | * Retrieves the HTTP method of the request.
|
|
0 commit comments