Reputation: 21
I want to redirect the url using the POST method.
The code is usually using this.Redirect("/", 302)
.
This time, I want something like post url which should redirect to that page.
Is this possible with Beego?
Thanks.
Upvotes: 1
Views: 1108
Reputation: 21145
Beego's Redirect
takes a http code, you're just using the wrong one. You want 307
to force the request method to be the same as the original one.
this.Redirect("/", 307)
Most clients and browsers issue a GET
on the 302 target, which was actually contrary to the RFC.
Due to this, 303 and 307 were introduced:
GET
requestPOST
if a POST
was originally used)Upvotes: 4