HTTP::REDIRECT 1g 2024-03-18 laplante@plcb.ca GOWEB/HTTP


author: laplante@plcb.ca category: GOWEB/HTTP date: 2024-03-18 title: “HTTP::REDIRECT Function”

version: 1.0.0

Name

http::redirect — Redirect to a new URL

Synopsis

http::redirect(url: string [, code: int])

Description

The http::redirect function redirects the client to a specified URL. By default, the redirection uses HTTP status code 302 Found unless another status code is specified.

Parameters

A predefined list of code is define in http::status.

Examples

// Redirect with default 302 status code
redirect("/new_url");

// Redirect with 301 Moved Permanently
redirect("/new_url", code: 301);

See also

Version