change button action to url address or bash script
There is a button in a site like this:
<form method="POST" action = "/invite/1233">
<input type="hidden" name="t" value="4b16d">
<button type="submit">submit</button>
</form>
How can I "emulate" pressing this button for example in bash? Is it possible to make an adress th开发者_如何学运维at I can click instead of this button? Why http://site-domain-here/invite/1233?t=4b16d
doesnt work?
On your terminal, assuming you have curl
installed (who doesn't?), run:
curl -d "t=4b16d" http://site-domain-here/invite/1233
The -d
option means that the request will be made with POST
.
In response to your addition to your question:
Why http://site-domain-here/invite/1233?t=4b16d doesnt work?
This is because by following the link above you are by default issuing a GET
request; not a POST
request with post data which is what the web page/service requires.
See http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods for an explanation of the various HTTP request "verbs".
精彩评论