Original post

Hello, I am trying to take form data submitted to a route on my website and forward it to another route.

So from my understanding there are two ways to submit form data of r.Values

http.PostForm()

but I cannot set the headers so I am not using this, and

http.Post()

My question is, do I have to consider anything when sending r.Form (r.Values) from one route to another?

I tried:

resp, err := http.PostForm(“http://localhost:3000/post”, r.Form)

and

req, err := http.NewRequest(“POST”, “http://localhost:3000/post”, strings.NewReader(r.Form.Encode))

and

req, err := http.NewRequest(“POST”, “http://localhost:3000/post”, r.Body)

also

req, err := http.Post(“http://localhost:3000/post”, “multipart/form-data”, r.Body)

non of these once it gets the http://localhost:3000/post retains any of the form or body data

Would anyone know how to correctly send formdata/values from one route to a next?

Any help would be appreciated.