5

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)" />

Code pasted here: http://hastebin.com/wihunayilu.xml

Trying curl with these values:

curl --data "revPhone:firstField=24988872&revPhone:city=CHENNAI" http://dq.sdc.bsnl.co.in/dq/reversePhone.seam?cid=812363 

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?

Thanks a lot

Prakhar
  • 3,486
  • 17
  • 44
  • 61
  • `--verbose` is helpful as well, this guide has more info: http://curl.haxx.se/docs/httpscripting.html – Kzqai Dec 20 '13 at 22:04

2 Answers2

9

You need to tell curl to make a POST

curl -X POST ....
Juri Glass
  • 88,173
  • 8
  • 33
  • 46
4

I don't know Firebug, but using Chrome is very easy:

  1. Hit F12,
  2. open the "Network" tab,
  3. check the "preserve log" check-box,
  4. submit the form.
Jonas Byström
  • 25,316
  • 23
  • 100
  • 147