Posted By:
Serge_Y
Posted On:
Tuesday, September 4, 2001 07:24 PM
I have to connect to website from my java program and read from it. Sound regular but
all regular steps doesn't work here 1. url.openConnection() 2. because of POST method ( login page has post) setDoOutput(true); setDoInput(true); setAllowUserInteraction(false); 3. Prepare OutputStreamWriter and writing to server osw.write( query) . Query contains param=value¶m=value
. 4. getInputStream and after reading line by line
5. And after that I parse or whatever
. That what I did before and it worked. But now I am trying to do the same to website that assign "session Id" as soon as I
More>>
I have to connect to website from my java program and read from it.
Sound regular but
all regular steps doesn't work here
1. url.openConnection()
2. because of POST method ( login page has post)
setDoOutput(true); setDoInput(true); setAllowUserInteraction(false);
3. Prepare OutputStreamWriter and writing to server
osw.write( query) . Query contains param=value¶m=value
.
4. getInputStream and after reading line by line
5. And after that I parse or whatever
.
That what I did before and it worked. But now I am trying to do the same to website that
assign "session Id" as soon as I logged in. So I can't send whole Query to last servlet
because I don't know the "sessionId" and as much I know can not read "first" response get "sessionId" and write next query to server (POST will not support it).
What should I do?
Thank you .
<<Less