cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: problem using curl to grab cgi script output

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Wed, 22 Nov 2006 11:56:02 -0600

On 11/22/06, Ian Downard <kayaking_at_gmail.com> wrote:
> I'm trying to use curl to grab the output of a cgi script, which gets invoked
> after I submit a username and password on an authentication page. Here's my
> command:
>
> curl -d "Username=myuser&Password=mypass&press=Submit"
> "http://myhost.mydomain.com/calendar.acgi"
>
> to which curl only outputs the following line:
>
> </html>r>/tr></table> colspan=2><IMG SRC=../images/clear.gif BORDER=0

That looks a bit suspicious - very badly formed html at the start of
the line... Have you written the html to a file and examined it with
a text editor?? I suspect the above may be the result of a number of
lines of output terminated by carriage-return rather than linefeed.

If that's the case, you'll likely see a bunch of table elements with
"IMG SRC=" tags that would make up the calendar when properly
rendered, which your browser would happily do by ignoring the
carriage-returns.

Ralph Mitchell
Received on 2006-11-22