cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: https redirect problem?

From: Iris Jing <iris_jing_at_msn.com>
Date: Wed, 13 Oct 2004 15:18:01 +0000

Thanks for kindly reply to my last message.

I still have one concern regarding user-agent. As Linus suggest, I can use
curl_easy_setopt(curl, CURLOPT_USERAGENT,"bla bla") to set up the user-agent
before
I send out the request, but my problem is: what should I put in "bla bla".
Is there any way to
figure out what kind of header the https server requires? I guess I have to
make the remote
server satisfied with the header I sent before it would allow me to get the
target file...

Thanks.

Best regards,
Iris

======On Tue, 12 Oct 2004, Iris Jing wrote:==============

>However, when I send request from my program like this:
>
>..curl_easy_setopt(curl, CURLOPT_URL,
>"password_at_my.xxxxx.net:443/NOTlogindir/MyTargetFile.jsp">https://username:password_at_my.xxxxx.net:443/NOTlogindir/MyTargetFile.jsp");
>
>I only obtained the login page (login.jsp).

No you I don't think you did. Since it sent no Location: header it didnt't
redirect, it was just the server that decided to respond back to you with
some
contents that you didn't expect. Perhaps the same contents as the login.jsp
page.

This is most likely not curl's fault since the command line version works. I
would guess that the server is stupidly doing this due to the lack of
user-agent field.

>So it seems to me that curl got passed the authentication and grab the file
>properly (*redirect* to MyTargetFile after login);

There is no "login" for this, the autentication credentials are passed on in
the request for that single page.

>For cookies, I tried to turn on the COOKIEJAR, but still didn't work out.

You didn't use cookies for the command line version.

>The cookies for Curl and libcurl are different because they're actually
>from
>different pages: Curl grabs cookies from MyTargetFile.jsp, while libcurl
>got
>it from login.jsp, that's what I assumed.

Cookies are very seldom for a specific page, they are for domains and paths.
And since the server didn't do any redirect, it _is_ the same page both
approaches get, it is just different contents (and cookies apparently) and
that's a server-side decision.

>I suspect that I either haven't got the right version of libcurl (I'm using
>curlpp0.3.1 now), or there could be something wrong with my program, but
>still couldn't figure out what it is. Should I use this one --
>curl-7.12.1.tar.gz at http://curl.haxx.se/download.html? Or you think it
>doesn't matter that I use curlpp0.3.1 or curl-7.12.1. Thanks.

I tend to always recommend the latest version (unless something really weird
is going on) and I still do. However, I don't think you suffer from a
libcurl
bug so I doubt it'll change the behaviour for you.

I can't say anything about the curlpp version as I know nothing about it.

_________________________________________________________________
FREE pop-up blocking with the new MSN Toolbar – get it now!
http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
Received on 2004-10-13