cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Uploading file to auth http server, when login url is different to upload url??

From: Ralph Mitchell <ralphmitchell_at_gmail.com>
Date: Thu, 2 Nov 2006 01:58:51 -0600

On 11/1/06, Theodore H. Smith <delete_at_elfdata.com> wrote:
>
> I'm trying to do something that is actually quite simple on the PC,
> but for the Mac I'm finding this hard. So this is a bit of a shame
> really.
>
> I want to log into into a certain url with http auth by supplying a
> name and password, and without breaking the http connection, then
> upload a file to a different url!

If the server is using Basic Auth, your command line would look in
part like this:

   curl -u username:password .... http://.....

The kicker is that you generally need to supply the username:password
arg on *every* command line. Unless the server hands you an
"authorized" cookie, but you said it didn't...

I've also had problems when going to a Basic Auth server and handing
it the userid/passwd along with the initial request. That confused it
somehow, so I had to resort to making the initial request without
authentication, getting the authentication demand, then retrying the
same request *with* the authentication.

It was probably a Windows server, but that may just be my natural
prejudice showing... :)

Ralph Mitchell
Received on 2006-11-02