45 throw new InvalidArgumentException(
'The first argument for this constructor should be a string or null, not an array. Did you upgrade from sabre/http 1.0 to 2.0?');
113 parse_str(substr(
$url,
$index + 1), $queryParams);
127 $this->absoluteUrl =
$url;
138 return $this->absoluteUrl;
159 $this->baseUrl =
$url;
194 $uri = str_replace(
'//',
'/', $this->
getUrl());
202 list($uri) = explode(
'?', $uri);
214 throw new \LogicException(
'Requested uri (' . $this->
getUrl() .
') is out of base uri (' . $this->
getBaseUrl() .
')');
271 if (isset($this->rawServerData[$valueName])) {
272 return $this->rawServerData[$valueName];
285 $this->rawServerData =
$data;
298 $out = $this->
getMethod() .
' ' . $this->
getUrl() .
' HTTP/' . $this->getHTTPVersion() .
"\r\n";
301 foreach ($value as $v) {
302 if (
$key ===
'Authorization') {
303 list($v) = explode(
' ', $v, 2);
getPath()
Returns the relative path.
The RequestInterface represents a HTTP request.
This is the abstract base class for both the Request and Response objects.
The Request class represents a single HTTP request.
setBaseUrl($url)
Sets a base url.
getRawServerValue($valueName)
Returns an item from the _SERVER array.
setMethod($method)
Sets the HTTP method.
setAbsoluteUrl($url)
Sets the absolute url.
getBaseUrl()
Returns the current base url.
setBody($body)
Replaces the body resource with a new stream or string.
getAbsoluteUrl()
Returns the absolute url.
getHeaders()
Returns all the HTTP headers as an array.
getBodyAsString()
Returns the body as a string.
static decodePath($path)
Decodes a url-encoded path.
getQueryParameters()
Returns the list of query parameters.
setPostData(array $postData)
Sets the post data.
setUrl($url)
Sets the request url.
setHeaders(array $headers)
Sets a new set of HTTP headers.
__construct($method=null, $url=null, array $headers=null, $body=null)
Creates the request object.
getPostData()
Returns the POST data.
getMethod()
Returns the current HTTP method.
getUrl()
Returns the request url.
normalize($uri)
Takes a URI or partial URI as its argument, and normalizes it.
setRawServerData(array $data)
Sets the _SERVER array.
__toString()
Serializes the request object as a string.