/** * Redirect the request to the given url. * * @param string|UrlObject $url * @param string|int|array $headers Headers that you wish to send with your request. * @param int $redirectCode */ protected static function httpRedirect($url, $headers = [], $redirectCode = 301) { $url = new UrlObject($url); $headers['Location'] = $url->val(); $response = new Response('', $redirectCode, $headers); $response->sendHeaders(); }
public function testSetters3() { $u = new UrlObject($this->url2); $u->setQuery(['name' => 'John', 'query' => 'nothing'], true); $this->assertSame('http://www.webiny.com/path/?query=nothing&name=John', $u->val()); }