使用cURL将数据POST到表单 [英] Using cURL to POST data to a form
本文介绍了使用cURL将数据POST到表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用cURL将资料张贴到这个网址的表单上:
I'm trying to use cURL to post data to the form on this URL:
http://dq.sdc.bsnl.co.in/dq/reversePhone.seam?cid=812363
查看其来源,形式看起来像
Seeing its source, the form looks like
<form id="revPhone" name="revPhone" method="post" action="/bsnl-web/reversePhone.seam;jsessionid=D238FA7A23A89A38C56B808B96F5D212" enctype="application/x-www-form-urlencoded" onkeyup="if (!check2(event)) {return false;};A4J.AJAX.Submit('loader2','revPhone',event,{'eventsQueue':'myqueue','parameters':{'revPhone:j_id16':'revPhone:j_id16'} ,'actionUrl':'/bsnl-web/reversePhone.seam;jsessionid=D238FA7A23A89A38C56B808B96F5D212','requestDelay':5} )">
<input type="hidden" name="revPhone" value="revPhone" />
<input type="hidden" name="revPhone:j_id12" />
<input id="revPhone:firstField" type="text" name="revPhone:firstField" maxlength="8" onkeydown="return removeEnter1(event)" />
此处粘贴的代码: http://hastebin.com/wihunayilu.xml
尝试使用这些值尝试curl:
Trying curl with these values:
curl --data "revPhone:firstField=24988872&revPhone:city=CHENNAI" http://dq.sdc.bsnl.co.in/dq/reversePhone.seam?cid=812363
我最后再次返回相同的页面作为响应。如何查看(使用firebug?)什么参数传递到post表单,以便我可以正确地发送请求到服务器?
I end up with the same page again as a response. How can I see (using firebug?) what parameters are passed to a post form so that I can correctly send the request to the server?
非常感谢
推荐答案
您需要告诉curl进行POST
You need to tell curl to make a POST
curl -X POST ....
这篇关于使用cURL将数据POST到表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文