cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: POST problems

From: Daniel Stenberg <Daniel.Stenberg_at_haxx.nu>
Date: Mon, 15 May 2000 10:58:06 +0200 (MET DST)

On Sun, 14 May 2000, Don Laursen wrote:

> I'm having problems posting to some forms (the submit-a-url cgis at Excite
> and Webcrawler) using curl -d. I've urlencoded the data and everything, and
> I've had success using curl with some other forms, but when I try these two
> forms, I get no response from the page and no error messages (even
> tried -S). This is the command line I'm using:
>
> curl -S -d
> "Service=webcrawler&url=http%3A%2F%2Fwww%2Eismi%2Enet%2F%7Edonl%2F&email=don
> l%40ismi%2Enet&language=English&country=US&channel=Games&look=excite"
> http://www.webcrawler.com/cgi-bin/add_url_new.cgi

You should try to use -i instead of -S and then you get a whole lot of
information you want.

It sends you a bunch of headers you should be interested in, even thought the
body is empty. The headers redirect you to another page and they set a few
cookies.

No, you can't use -L to follow the location since then you'd make a second
POST to the new page. (any suggestions how that could be changed are welcome)

> I've also tried -F instead of -d, but that didn't help.

No, it will only confuse the site.

> if I'm doing something wrong, or if there's any way I can diagnose this
> problem. It's frustrating not even getting an error message...

You should _always_ start with using -i and -v to get a hint about what's
sent and what's received to better understand everything.

-- 
   Daniel Stenberg - http://www.contactor.se/~dast - +46-705-44 31 77
   ech`echo xiun|tr nu oc|sed 'sx\([sx]\)\([xoi]\)xo un\2\1 is xg'`ol
Received on 2000-05-15