It's the client which does the redirect, it's up to it to accept your 
request, most will not accept redirects with POST method, for obvious 
security reason.

Le samedi 28 octobre 2017 21:12:16 UTC+2, Hui Kang a écrit :
>
> Hi,
> I have a question about sending POST request through the http.Redirect 
> function.
> The following is my http handler function. In this function, I get some 
> secret data and want to pass the data to the redirectURL.
> I could not use GET with query parameter because the secret data is 
> explicit as a query in a GET redirect URL. So I am thinking sending the 
> data in the body of a POST request.
>
> func myHandler (w http.ResponseWriter, r *HTTPRequest) {
>     // process and get some secret data
>     data := someValue
>     http.Redirect(w, r, redirectURL, http.StatusFound)
> }
>
> I tried setting "r.Method="POST""; however it does not work.
> Could anyone help on this? Thanks. in advance.
>
> - Hui
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to