Set HTTP redirect status code.

@param int|false $redirectStatus Redirect HTTP status code

@return self
355159
public function redirect($redirectStatus = 302)
    {
        if (!in_array($redirectStatus, [false, 301, 302], true)) {
            throw new InvalidArgumentException('The redirect status code must be 301, 302 or false');
        }

        $this->redirectStatus = $redirectStatus;

        return $this;
    }
89784
protected function redirect($location, $status = 302, $headers = array()) {
		// Check if a output action has be already performed
		$this->_checkIfPerformed();

		// Create a redirect
		$redirectResponse = \Symfony\Component\HttpFoundation\RedirectResponse::create($location, $status, $headers);

		// Add request informationen
		$redirectResponse->prepare($this->application->requestStack->getCurrentRequest());

		// Replace response object
		$this->application->response = $redirectResponse;

		// Don't use a template
		$this->useTemplate(false, $status);
	}
136248
public function setRedirectUri($redirect_uri)
    {
        // $redirect_uri = trim(urldecode($redirect_uri));
        $redirect_uri = trim($redirect_uri);
        if (filter_var($redirect_uri, FILTER_VALIDATE_URL) === false) {
            throw new Exception('$redirect_uri无效');
        }
        $this->_redirect_uri = urlencode($redirect_uri);
    }
833678
private function send_status_headers() {
	if ($this->redirect_location) {
		if ($this->http_status == self::STATUS_OK) {
			$this->set_http_status(self::STATUS_TEMPORARY_REDIRECT);
		}
		
		header('Location: '.$this->redirect_location, $replace=true, $this->http_status);
		return;
	}
	
	http_response_code($this->http_status);
}
1088425
public function redirect ($url, $statusCode = 302)
		{
			parent::redirect($url, $statusCode);
			Yii::$app->end();
		}
888181
public function redirect(ClientInterface $client, string $url, int $status = 302): EndPointInterface
    {
        $client->acceptResponse(new Response\RedirectResponse($url, $status));

        return $this;
    }
1367305
public function redirect($uri, $destination, $status = 302)
    {
        return $this->any($uri, '\Illuminate\Routing\RedirectController')
                ->defaults('destination', $destination)
                ->defaults('status', $status);
    }
1207929
public function setRedirectUri(UriInterface $uri, int $statusCode = 303): void
    {
        $this->redirectUri = $uri;
        $this->statusCode = $statusCode;
        // TODO: This can be removed after the full changes are done for next major.
        $this->headers->set('Location', (string)$uri, true);
        $this->setStatusCode($statusCode);
    }
1039560
public function redirect(string $location, int $code = Status::FOUND): self
    {
        $this->setStatus($code)->setHeader('Location', trim($location));

        return $this;
    }
640755
protected function redirect($url, $status = 302)
    {
        return $this->getResponse()
            ->withStatus($status)
            ->withHeader('Location', (string)$url);
    }
1000126
public function setStatus($status)
	{
		$status = (int)$status;

		if($status < 100)
		{
			throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
		}
		
		if($status >= 600)
		{
			throw new \InvalidArgumentException(sprintf('Invalid HTTP status code: %u', $status));
		}
		
		$this->status = $status;
		
		return $this;
	}
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);
    }
516016
public static boolean isRedirect(int statusCode) {
    switch (statusCode) {
      case HttpStatusCodes.STATUS_CODE_MOVED_PERMANENTLY: // 301
      case HttpStatusCodes.STATUS_CODE_FOUND: // 302
      case HttpStatusCodes.STATUS_CODE_SEE_OTHER: // 303
      case HttpStatusCodes.STATUS_CODE_TEMPORARY_REDIRECT: // 307
        return true;
      default:
        return false;
    }
  }
304713
def set_redirect(self, url, status=HttpStatusCodes.HTTP_303):
        
        self.set_status(status)
        self.set_content('')
        self.set_header(HttpResponseHeaders.LOCATION, url)
920001
protected function redirect($url = null, $queryParams = [], $statusCode = 302) {

		if(is_null($url)) {
			return $this->route->redirect($queryParams, $statusCode);
		}

		if($queryParams) {
			$query = (strpos($url, '?') === false ? '?' : '&') . http_build_query($queryParams);
		}

		else {
			$query = '';
		}

		return new RedirectResponse($url . $query, $statusCode);

	}
1092638
public function redirect($dest, $code = 302)
    {
        if (!in_array($code, self::$redirect_codes)) {
            trigger_error("Invalid HTTP redirect code {$code}", E_USER_WARNING);
            $code = 302;
        }
        $this->setStatusCode($code);
        $this->addHeader('location', $dest);
        return $this;
    }
497685
public function setRedirectUrl($redirectUrl = '')
    {
        $this->redirectUrl = $redirectUrl;
        $this->debug->debug(__FUNCTION__, 'setRedirectUrl: ' . json_encode($this->redirectUrl));

        return $this;
    }