http.Redirect(w, r, "/", http.StatusFound)

      Go language logo
      http Redirect

      Go Code Snippets

      The code tells the web browser to take the request to the specified URL, but instead of rendering the page, to take the request to the Redirect resource instead. The Redirect resource is responsible for handling the status code and redirecting the browser to the appropriate page. The code uses the http.StatusFound status code to indicate that the requested page was found.

      Shortcut: rd


        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.