diff --git a/src/RequestInterface.php b/src/RequestInterface.php index cad8d61..ab12daf 100644 --- a/src/RequestInterface.php +++ b/src/RequestInterface.php @@ -21,56 +21,41 @@ interface RequestInterface extends MessageInterface { /** - * Retrieves the message's request line. + * Retrieves the message's request target. * - * Retrieves the message's request line either as it will appear (for + * Retrieves the message's request-target either as it will appear (for * clients), as it appeared at request (for servers), or as it was - * specified for the instance (see withRequestLine()). + * specified for the instance (see withRequestTarget()). * - * This method MUST return a string of the form: + * In most cases, this will be the origin-form of the composed URI, + * unless a value was provided to the concrete implementation (see + * withRequestTarget() below). * - * - * HTTP_METHOD REQUEST_TARGET HTTP/PROTOCOL_VERSION - * - * - * If the request line is calculated at method execution (i.e., not from - * a value set on the instance), the request-target MUST be in origin-form. - * - * If any aspect of the request line is unknown, it MUST raise an - * exception. + * If no URI is available, and no request-target has been specifically + * provided, this method MUST return the string "/". * * @return string - * @throws \RuntimeException if unable to construct a valid request line. */ - public function getRequestLine(); + public function getRequestTarget(); /** - * Create a new instance with a specific request line. - * - * If the request needs a specific request line — for instance, to allow - * specifying an absolute-form, authority-form, or asterisk-form - * request-target — this method may be used to create an instance with - * the specified request line, verbatim. - * - * This method MUST validate that the line is in the form: - * - * - * HTTP_METHOD REQUEST_TARGET HTTP/PROTOCOL_VERSION - * + * Create a new instance with a specific request-target. * - * and raise an exception if not. + * If the request needs a non-origin-form request-target — e.g., for + * specifying an absolute-form, authority-form, or asterisk-form — + * this method may be used to create an instance with the specified + * request-target, verbatim. * * This method MUST be implemented in such a way as to retain the * immutability of the message, and MUST return a new instance that has the - * changed request line. + * changed request target. * * @link http://tools.ietf.org/html/rfc7230#section-2.7 (for the various * request-target forms allowed in request messages) - * @param mixed $requestLine + * @param mixed $requestTarget * @return self - * @throws \InvalidArgumentException for invalid request lines. */ - public function withRequestLine($requestLine); + public function withRequestTarget($requestTarget); /** * Retrieves the HTTP method of the request.