Is there a way that i can do a POST (like in forms) through a URL?
Printable View
Is there a way that i can do a POST (like in forms) through a URL?
nope. that's what GET is used for.
didnt think so. how about submiting a form from a link?
no. you can't do that. that's what GET is for.
it might be possible to submit something automatically using JavaScript, but I somehow doubt it, because it would be a huge security risk if you think about it.
Huh? It's no more of a security risk than submitting a form manually...
You can either make a POST request with manual payload using XMLHttpRequest; or (easier) you can just call the submit() method of a form element on the page. I do this in one Javascript application to save form variables when switching pages; it works without a hitch.
Anchor links point to another resource, not an action: that's why they are effected using GET requests.
You can also style a button|type="submit" to look like a link. I do this for logout links sometimes, because logout is a state-changing action and should thus be a POST request, yet style issues prohibit using an ugly button for that. And I have no graphical skills whatsoever.