getQuery() публичный Метод

Returns the URI's query part
public getQuery ( ) : string
Результат string The query part
Пример #1
0
 /**
  * @test
  */
 public function constructorParsesArgumentsWithSpecialCharactersCorrectly()
 {
     $uriString = 'http://www.neos.io/path1/?argumentäöü1=' . urlencode('valueåø€œ');
     $uri = new Uri($uriString);
     $check = $uri->getScheme() == 'http' && $uri->getHost() == 'www.neos.io' && $uri->getPath() == '/path1/' && $uri->getQuery() == 'argumentäöü1=value%C3%A5%C3%B8%E2%82%AC%C5%93' && $uri->getArguments() == ['argumentäöü1' => 'valueåø€œ'];
     $this->assertTrue($check, 'The URI with special arguments has not been correctly transformed to an URI object');
 }
Пример #2
0
 /**
  * Return the Request-Line of this Request Message, consisting of the method, the uri and the HTTP version
  * Would be, for example, "GET /foo?bar=baz HTTP/1.1"
  * Note that the URI part is, at the moment, only possible in the form "abs_path" since the
  * actual requestUri of the Request cannot be determined during the creation of the Request.
  *
  * @return string
  * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1
  * @api
  */
 public function getRequestLine()
 {
     $requestUri = $this->uri->getPath() . ($this->uri->getQuery() ? '?' . $this->uri->getQuery() : '') . ($this->uri->getFragment() ? '#' . $this->uri->getFragment() : '');
     return sprintf("%s %s %s\r\n", $this->method, $requestUri, $this->version);
 }