cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: cURL usage dilemma

From: Ralph Mitchell <rmitchell_at_eds.com>
Date: Tue, 30 Apr 2002 00:07:11 -0500

Using "-b empty.txt" just starts the cookie engine and, if there is anything in the file, sends those cookies. To save cookies between invocations of Curl, you need to use "-c empty.txt" as well.

i.e. curl -b cookies.txt -c cookies.txt .......

Ralph Mitchell

David Withnall wrote:

> Greetings,
>
> I'm new to all this but I think i've figured out most of my problems except this one.
> I'm trying to use cURL to connect to a https server to upload form data for work. I've managed to get it to connect to the server, however when you try to connect directly to the page with the form on it you get redirected to the front page. This happens in both cURL & IE/Netscape. The difference being that when you try to go directly to the page with the form on it a second time in IE/Netscape you end up there with the form staring you in the face, I have not managed to get cURL to do this however.
>
> I'm using the syntax
> curl -v -A "Mozilla/4.5 (compatible; MSIE 5.0; Windows NT)" -u User:Pass https://domain/page.html
> (I'd pass on the username/password etc but i've signed confidentiality agreements and i need the money from my job :) )
>
> this connects without any problems to the front page (https://domain/) I then tried to do a simultaneous connection hoping to simulate reloading the page twice in a browser
>
> curl -v -A "Mozilla/4.5 (compatible; MSIE 5.0; Windows NT)" -u User:Pass https://domain/page.html https://domain/page.html
>
> still had the same problem.
>
> so next i tried cookies as the site sets a session cookie which relates to the whole site
> so as per the manual
>
> curl -v -b empty.txt -L -A "Mozilla/4.5 (compatible; MSIE 5.0; Windows NT)" -u User:Pass https://domain/page.html https://domain/page.html
>
> i found a discussion on the forum archive where someone had a problem that was similar and his solution turned out to be setting the referrer to the page he wanted to go too.
>
> Basically I've tried everythign I can think of. I believe it has something to do with headers or cookies but I'm not sure. I can't find anythign which will show me the http headers being transfered in the browser to make sure.
>
> This is all being done in a windows environment and I don't have access to any *nix boxes. If anyone has any suggestions I'd be much appreciative. I'd rather automate the entry of the several thousand things that we have to type in if possible.
>
> Cheers
> D.
>
> ------------------------------------------------------------------------------
> David Withnall Ph: 07 3406 8079
> Biomedical Engineer Mb: 0405 131 087
> Asset Management and Technical Audit Program
> Biomedical Technology Services
> Queensland Health
>
> **********************************************************************
> This e-mail, including any attachments sent with it, is confidential
> and for the sole use of the intended recipient(s). This confidentiality
> is not waived or lost if you receive it and you are not the intended
> recipient(s), or if it is transmitted/ received in error.
>
> Any unauthorised use, alteration, disclosure, distribution or review
> of this e-mail is prohibited. It may be subject to a statutory duty of
> confidentiality if it relates to health service matters.
>
> If you are not the intended recipient(s), or if you have received this
> e-mail in error, you are asked to immediately notify the sender by
> telephone or by return e-mail. You should also delete this e-mail
> message and destroy any hard copies produced.
> **********************************************************************
Received on 2002-04-30