2
namespace GuzzleHttp\Message;
4
use GuzzleHttp\Event\HasEmitterInterface;
8
* Generic HTTP request interface
10
interface RequestInterface extends MessageInterface, HasEmitterInterface
13
* Sets the request URL.
15
* The URL MUST be a string, or an object that implements the
16
* `__toString()` method.
18
* @param string $url Request URL.
20
* @throws \InvalidArgumentException If the URL is invalid.
22
public function setUrl($url);
25
* Gets the request URL as a string.
27
* @return string Returns the URL as a string.
29
public function getUrl();
32
* Get the resource part of the the request, including the path, query
33
* string, and fragment.
37
public function getResource();
40
* Get the collection of key value pairs that will be used as the query
41
* string in the request.
45
public function getQuery();
48
* Set the query string used by the request
50
* @param array|Query $query Query to set
52
public function setQuery($query);
55
* Get the HTTP method of the request.
59
public function getMethod();
62
* Set the HTTP method of the request.
64
* @param string $method HTTP method
66
public function setMethod($method);
69
* Get the URI scheme of the request (http, https, etc.).
73
public function getScheme();
76
* Set the URI scheme of the request (http, https, etc.).
78
* @param string $scheme Scheme to set
80
public function setScheme($scheme);
83
* Get the port scheme of the request (e.g., 80, 443, etc.).
87
public function getPort();
90
* Set the port of the request.
92
* Setting a port modifies the Host header of a request as necessary.
94
* @param int $port Port to set
96
public function setPort($port);
99
* Get the host of the request.
103
public function getHost();
106
* Set the host of the request including an optional port.
108
* Including a port in the host argument will explicitly change the port of
109
* the request. If no port is found, the default port of the current
110
* request scheme will be utilized.
112
* @param string $host Host to set (e.g. www.yahoo.com, www.yahoo.com:80)
114
public function setHost($host);
117
* Get the path of the request (e.g. '/', '/index.html').
121
public function getPath();
124
* Set the path of the request (e.g. '/', '/index.html').
126
* @param string|array $path Path to set or array of segments to implode
128
public function setPath($path);
131
* Get the request's configuration options.
133
* @return \GuzzleHttp\Collection
135
public function getConfig();