Skip to content

How to redirect my request? #1088

Closed
Closed

Description

@OhhhThatVarun

So, I want to redirect my request to some other service. But the function redirect requires access to ResponseWriter and *Request. I'm not getting where to put the redirect. Any help would be appreciated.

Activity

  1. peterbourgon commented on May 12, 2021

    @peterbourgon
    Member

    Why? The answer will inform the best design.

  2. whiteboy19787bm commented on May 13, 2021

    @whiteboy19787bm

    I would like to try but I would need a tutor

  3. xescugc commented on May 13, 2021

    @xescugc
    Contributor

    If you want to do it on a "encoder", what I normally use is

    	w.Header().Set("Location", "/redirected-location")
    	w.WriteHeader(http.StatusSeeOther)
    
  4. locked and limited conversation to collaborators on Jul 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions