cURL / Mailing Lists / curl-library / Single Mail



From: Alex Kelly <>
Date: Tue, 09 May 2006 16:53:35 -0400

> On Tue, May 09, 2006 at 03:45:48PM -0700, Alex Kelly wrote:
>> When I add "curl_easy_setopt(queue, CURLOPT_USERPWD, userpass);" to my
>> code,
>> libcurl thinks that I want to download the webpage, instead of post to
>> it.
> Whenever you POST to a web page, you also download the results of that
> post.
> It sounds like your adding of the login info to the request causes the
> site to
> authenticate you and delivers more data in response to your POST than
> you would get otherwise. That's what I would expect to happen.
>> Is there a way to pass the username and password to a website so I can
>> POST?
> Just the way you've done. Depending on how the site handles
> authentication,
> you might have to specify the authentication method. This assumes that
> the
> site doesn't actually require an SSL certificate instead of using an HTTP
> authentication method.
>>>> Dan
> --
> The web change of address
> service
> Let webmasters know that your web site has moved

Thanks, Dan. That makes sense. Yeah, I added the username and password
line and I end up downloading the whole remote webpage.

It sounds like I could just discard the response data (the downloaded
remote webpage), then create an if/else statement to check if there is
response data.

If response data, then POST was successful...else no response data, POST
was unsuccessful.
Received on 2006-05-09