POST to web form using CURL & BASH

-1

I'm trying, without success, to use cURL to post data to the form on this URL:

https://nic.ar/buscarDominio.xhtml

how can i correctly send the request to the server?

I've analysed the post data with chrome (right click, inspect element, network tab), copy as CURL:

curl 'https://nic.ar/buscarDominio.xhtml' -H 'Cookie: JSESSIONID=!hh6JmwccX43y6ULiN5rkqiT19gIki8NN0dqDBgaDtQ+kRKM3qulJksgmqjFkb1N+dmFkEA5UteMiyTaLuahx481KkIte4g==; NIC=1007948204.20480.0000; TS2785e3=62b722def584484a84a892fda4181cd30f4798093eac408f542740be60ac0ec5d6bd720d4045274b4076e350; TS2785e3_77=5412_a812844049fdca3a_rsb_0_rs_https%3A%2F%2Fnic.ar%2FbuscarDominio.xhtml_rs_0_rs_0' -H 'Origin: https://nic.ar' -H 'Accept-Encoding: gzip,deflate' -H 'Accept-Language: es-419,es;q=0.8,en-US;q=0.6,en;q=0.4' -H 'User-Agent: Mozilla/5.0 (X11; Linux i686) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.120 Chrome/37.0.2062.120 Safari/537.36' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8' -H 'Cache-Control: max-age=0' -H 'Referer: https://nic.ar/buscarDominio.xhtml' -H 'Connection: keep-alive' --data 'busquedaDominioForm2=busquedaDominioForm2&javax.faces.ViewState=3588315592207743676%3A-7314103686046665250&busquedaDominioForm2%3Adominio=example&busquedaDominioForm2%3Aj_idt56=2&busquedaDominioForm2%3AbtnBuscar=Consultar' --compressed

But when i run that get empty response from server

Thanks a lot

user1478993

Posted 2014-09-28T11:03:20.600

Reputation: 1

Download nic.ar/buscarDominio.xhtml, extract its information to create your post request, send your post request and next time start with first step again. – Cyrus – 2014-09-28T12:19:57.417

Right! dont know where to start... – user1478993 – 2014-09-28T21:49:21.073

Answers

0

I'm not an expert regarding how to use cURL, in fact I've never used it. However when I looked it up it stated the proper syntax for it was

curl [options] [URL...]

In your post it appears you've got the URL first, and your options after. Maybe it is failing to post data because the URL is first and thus the curl command sees no options to pass to it.

Mason

Posted 2014-09-28T11:03:20.600

Reputation: 50