cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: dynamic url

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Fri, 11 Apr 2003 11:04:20 +0200 (CEST)

On Thu, 10 Apr 2003 palmkes_at_berghmans.org wrote:

> I have a question about using curl and sessions. Given the commad
>
> curl -u user:pass -d "DATATOPOST"
> http://someurl/dispatch;jsessionid=bzlh059si1.t19L
>
> I want to post data to an url, but the url itself is related to a session.
> Now I want curl to open a session and put the right sessionid in the url.
> How can this be done?

You need to make curl do the same things your browser does when you do this
manually.

Most likely you:

 1. get the login page
 2. submit a login-post
 3. receive the cookies and response HTML
 4. figure out the "session-URL" (in the HTML)
 5. gets that one, passing along the cookies etc.
 6. WHILE ( there might be more URLs to get ) GOTO 4

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger 
for complex code. Debugging C/C++ programs can leave you feeling lost and 
disoriented. TotalView can help you find your way. Available on major UNIX 
and Linux platforms. Try it free. www.etnus.com
Received on 2003-04-11