Create a new redirect response.

@param  string  $path
@param  int     $status
@param  array   $headers
@return RedirectResponse
191708
protected function createRedirect($path, $status, $headers)
    {
        $response = new RedirectResponse($path, $status, $headers);

        // Session
        if (isset($this->session)) {
            $response->setSession($this->session);
        }

        // Request
        $response->setRequest($this->generator->getRequest());

        return $response;
    }
1254586
protected function post($path, array $parameters = array(), $requestHeaders = array())
    {
        return $this->postRaw(
            $path,
            $this->createParametersBody($parameters),
            $requestHeaders
        );
    }
976673
protected function redirect($uri, $status = 302, array $headers = []): ResponseInterface
    {
        return $this->responseFactory->createRedirectResponse($uri, $status, $headers);
    }
350990
public function redirect($uri, int $status = 301): ResponseInterface
    {
        if (!\is_string($uri) && !$uri instanceof UriInterface) {
            throw new \InvalidArgumentException('Uri MUST be a string or Psr\Http\Message\UriInterface instance; received "' .
                (\is_object($uri) ? \get_class($uri) : \gettype($uri)) . '"');
        }

        $this->header->set('Location', (string) $uri);

        return $this->empty($status);
    }
1324174
public function redirectToRoute($route, array $parameters = [], $status = 302)
    {
        return new RedirectResponse($this['url_generator']->generate($route, $parameters), $status);
    }
87137
public function guest($path, $status = 302, $headers = [], $secure = null)
    {
        $request = $this->generator->getRequest();

        $intended = $request->method() === 'GET' && $request->route() && ! $request->expectsJson()
                        ? $this->generator->full()
                        : $this->generator->previous();

        if ($intended) {
            $this->setIntendedUrl($intended);
        }

        return $this->to($path, $status, $headers, $secure);
    }
497816
public function redirect($route, $parameters = array(), $status = 302, $headers = array())
    {
        return Redirect::route('admin.'.$route, $parameters, $status, $headers);
    }
372774
public function respond($response, $status, $headers, $options)
    {
        switch ($this->getRequestFormat()) {
            case 'html' :
            case 'text/html' :
                return Response::make($response, $status, $headers, $options)
                    ->header('Content-Type', 'text/html');
            default :
                // whether 'Content-Type' is NULL or equal to anything such as 'application/json' response will be JSON
                return Response::json($response, $status, $headers, $options);
        }
    }
744927
protected static function createRedirectResponse($url, $code, $headers)
    {
        $r = new RedirectResponse($url, $code, $headers);
        $r->setRequest(Request::getInstance());

        return $r;
    }
1366410
protected function httpPostRaw(string $path, $body, array $requestHeaders = []): ResponseInterface
    {
        try {
            $response = $this->httpClient->sendRequest(
                $this->requestBuilder->create('POST', $path, $requestHeaders, $body)
            );
        } catch (Psr18\NetworkExceptionInterface $e) {
            throw HttpServerException::networkError($e);
        }

        return $response;
    }
767403
protected function post(string $path, array $params = [], array $headers = [])
    {
        $body = self::createJsonBody($params);

        if ($body) {
            $headers = self::addJsonContentType($headers);
        }

        return $this->postRaw($path, $body, $headers);
    }
116161
protected function httpGet(string $path, array $params = [], array $requestHeaders = []): ResponseInterface
    {
        if (count($params) > 0) {
            $path .= '?'.http_build_query($params);
        }

        return $this->httpClient->sendRequest(
            $this->requestBuilder->create('GET', $path, $requestHeaders)
        );
    }
172140
public static function createRedirect($url, $statusCode = Response::HTTP_FOUND, array $headers = [])
    {
        $view = static::create(null, $statusCode, $headers);
        $view->setLocation($url);

        return $view;
    }
1180450
protected function redirectToRoute(string $route, $parameters = [], int $status = 302): RedirectResponse
    {
        return $this->redirect($this->generateUrl($route, $parameters), $status);
    }
312913
public function action( $action, $parameters = [], $status = 302, $headers = [] )
	{
		$path = $this->generator->action( $action, $parameters );

		return $this->to( $path, $status, $headers );
	}
206656
public function redirectToAction($action, $parameters = array(), $status = 302, $headers = array())
	{
		return $this->redirector->action($action, $parameters, $status, $headers);
	}
507343
public function route($route, $parameters = [], $status = 302, $headers = [])
    {
        return $this->to($this->generator->route($route, $parameters), $status, $headers);
    }