catdontdo
asked on
Redirecting GET as POST
I have a website that navigates via a form "POST" (not GET)
method. So you can't have a naked URL that drops a customer
on an item page.
When I go to do promotions it is impossible to have a
link right to a particular item
I am looking for a way (a Script ?)
That parses a regular (GET) hyperlink which contains elements
for the POST form.
When the server receives the request it would cause the browser to
redirect using the elements provided as a POST request
as though the customer was normally navigating my site.
method. So you can't have a naked URL that drops a customer
on an item page.
When I go to do promotions it is impossible to have a
link right to a particular item
I am looking for a way (a Script ?)
That parses a regular (GET) hyperlink which contains elements
for the POST form.
When the server receives the request it would cause the browser to
redirect using the elements provided as a POST request
as though the customer was normally navigating my site.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Steve does make a good point... when using any additional framework or library you want to make sure that you're not "bloating" your site with unnecessary code. And of course I've assumed PHP which would be a deal-breaker if you're not using it! :)
One of the main reasons I use a router is for SEO. Being able to take GET routes and essentially do what you can with POST and vice-versa but having "friendly" urls will help your site rank well in the search engines.
One of the main reasons I use a router is for SEO. Being able to take GET routes and essentially do what you can with POST and vice-versa but having "friendly" urls will help your site rank well in the search engines.
I am not so sure that slim will work here.
If I understand correctly, the question is about sending a 3xx redirection back to the client in response to a GET request, that will force the client to POST and get to the real location.
As far as I know this is not how HTTP works.
The only trick that may work is dynamic construction of a POST form, using the GET query string values in hidden fields, and use setTimeout to auto-submit the form to the target location.
If I understand correctly, the question is about sending a 3xx redirection back to the client in response to a GET request, that will force the client to POST and get to the real location.
As far as I know this is not how HTTP works.
The only trick that may work is dynamic construction of a POST form, using the GET query string values in hidden fields, and use setTimeout to auto-submit the form to the target location.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What language/platform are you using for your current site?