HttpImpl.redirect

Creates a 3xx redirect response and adds the Location field to the header. If not specified status code 301 Moved Permanently will be used.

  1. void redirect(Status status, string location)
    class HttpImpl
    static if(user == User.server && type == Type.response)
    void
    redirect
  2. void redirect(uint statusCode, string location)
  3. void redirect(string location)

Examples

http.redirect("/index.html");
http.redirect(302, "/view.php");
http.redirect(StatusCodes.seeOther, "/icon.png");

Meta