cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: how to exceute script instaed of downloading it

From: Robert Bednar <boborama_at_embarqmail.com>
Date: Sat, 15 Sep 2012 15:03:59 -0400

Essentially all web servers receive a page request from the client (typically a browser...but in this instance it's curl) and serve the page to the client. It's up to the client to interpret the page...render it in a GUI window..run embedded java script...or whatever. Curl doesnt contain a rendering engine or JavaScript interpreter. It just received the stream if bytes from the server. So saving it to disk is probably the best you can hope for with curl alone. Sounds like what he needs is a headless browser? Maybe? Server side code (cgi scripts etc) should "run". They are part of the "response" from the web server.

Sent from my iPhone

On Sep 15, 2012, at 2:18 AM, Shoeb Ali <shoeb.ali_at_sasken.com> wrote:

> Hi Fredrik,
> Thanks for your reply. Yes this is really what i get. What i really need is the value of req.responseText in the code.
>
> Regards,
> Shoeb
> ________________________________________
> From: curl-users [curl-users-bounces_at_cool.haxx.se] On Behalf Of Fredrik Gustafsson [iveqy_at_iveqy.com]
> Sent: Friday, September 14, 2012 10:48 PM
> To: the curl tool
> Subject: Re: how to exceute script instaed of downloading it
>
> On Fri, Sep 14, 2012 at 09:17:09PM +0530, Shoeb Ali wrote:
>> Hi,
>> when i do "curl http://myserver.com/Test.jsp" curl downloads Test.jsp. What i want is execute the Test.jsp and see the result. Please help me.
>> //what i see on the console.
>> function processStateChange() {
>> if (req.readyState == 4) { // Complete
>> //alert(req.readyState);
>> if (req.status == 200) { // OK response
>> //alert(req.status);
>> res="< LICENSERESPONSE > < LICENSE version=2.0.0.0>"+req.responseText+"< /LICENSE >< /LICENSERESPONSE >";
>> //alert(req.responseText);
>> document.getElementById('divId').innerHTML = res;
>>
>> } else {
>> alert("Problem: " + req.statusText);
>> }
>> }
>>
>> // what i see in the browser and what i exactly want
>> < LICENSERESPONSE > < LICENSE version=2.0.0.0> *DGD1rz2UdqU1qYR0OZ4nYL08jTaiFmHZyUlwn2WJiZuOA3dQEYHJtOX!Xx8P*YeDXWMSn*1i0HDJDItHSR1xtKPMuZDYcy7Jkc7wjGjCUSADXp2gqiVkSP < /LICENSE >< /LICENSERESPONSE >
>>
>
> Curl does network traffic, not javascript interpretion. I suggest you
> read the javascript code, find out what it does and then do that locally
> instead. Is the code above really everything you get?
>
> --
> Med vänliga hälsningar
> Fredrik Gustafsson
>
> tel: 0733-608274
> e-post: iveqy_at_iveqy.com
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>
> SASKEN BUSINESS DISCLAIMER: This message may contain confidential, proprietary or legally privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, disclose, distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated. Nothing contained in this message shall be construed as an offer or acceptance of any offer by Sasken Communication Technologies Limited ("Sasken") unless sent with that express intent and with due authority of Sasken. Sasken has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email.
> Read Disclaimer at http://www.sasken.com/extras/mail_disclaimer.html
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-09-15