cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Enable javascript with curl

From: Ray Satiro via curl-users <curl-users_at_cool.haxx.se>
Date: Tue, 10 May 2016 14:59:31 -0400

On 5/8/2016 11:49 PM, Sourin Maiti wrote:
>
> I am still not able to use the curl in correct way in my case. I have
> checked it in fiddler and can see the data is available on third
> request, will you be able to verify the fiddler and suggest me the
> correct steps to fetch the data?

see below

On 5/5/2016 6:57 AM, Sourin Maiti wrote:
> The Raw fiddler entry is:
>
> POST
> http://vhlxxxxxxxxx.xxxxxxx.xxx:00000/AirShopMonitor/monitor/UIDL?repaintAll=1&sh=768&sw=1364&cw=1364&ch=629&vw=1364&vh=629&fr=
> HTTP/1.1
> Accept: */*
> Content-Type: text/plain;charset=utf-8
> Referer: http://vhlxxxxxxxxx.xxxxxxx.xxx:00000/AirShopMonitor/monitor
> Accept-Language: en-US
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0)
> like Gecko
> Host: vhlxxxxxxxxx.xxxxxxx.xxx:00000
> Content-Length: 5
> Connection: Keep-Alive
> Pragma: no-cache
> Cookie: JSESSIONID=0000QLuOOXg2GAujSyot2ncD_Yf:180reu25m
>
> init
>
>
> I am able to see the required data in TEXT view and Syntax View but
> not in Raw response, I am not able to create the curl request with it.

Did you write the company to find out if they have an API or any advice
for you? The request will look like:

curl -b cookies.txt -c cookies.txt --data-binary @postdata.txt -H
"Content-Type: text/plain;charset=utf-8" --referer
"http://vhlxxxxxxxxx.xxxxxxx.xxx:00000/AirShopMonitor/monitor"
"http://vhlxxxxxxxxx.xxxxxxx.xxx:00000/AirShopMonitor/monitor/UIDL?repaintAll=1&sh=768&sw=1364&cw=1364&ch=629&vw=1364&vh=629&fr="

In postdata.txt you should put the request body. Right-click on the POST
session in Fiddler and Save > Request > Request Body. The file should
contain 5 bytes, the first four 'init'.

In cookies.txt it should contain your JSESSIONID. You will have to login
to get the ID. That is likely another POST which comes first, or you
could try exporting cookies from an already logged in session. How well
that works depends on how long it keeps you logged in.

Look at the URL you are posting to, there is a lot of uniqueness there,
sh sw cw, I don't know what any of that is. You may end up initializing
some old test and not the one you want.
-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-users
FAQ: https://curl.haxx.se/docs/faq.html
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-05-10