SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Originally posted by Ibrahim Hashimi:
We'll here is how it is. Every week I have to go to a website then login. Then I have to mark a few checkboxes. Then I click the "Submit" button. This prompts the server to generate a file based on a database that they have. Then when that file has been generated, a URL to that file is returned then I download it. Now I'm trying to automate this.
I tried creating a URL with the parameters like this
www.thewebsite.com\login.asp?username=myusername&password=mypassword&check=on
But it doesn't seem to recognize those parameters. As a side note i took that same URL and placed it in a Browser and it doesn't make those settings. Maybe I'm incorrectly formatting it.
On top of that I have to "click" that submit button, how could I do this in Java?
Thanks in advance.
SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Is the response encoded in the first place? Can you post the response text and/or locate where the decode function breaks exactly?Originally posted by Ibrahim Hashimi:
[...] when I try to decode the results with URLDecoder it always throws an IllegalArgumentException:
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
SCJP 1.4<br /><a href="http://www.cise.ufl.edu/~sih" target="_blank" rel="nofollow">www.cise.ufl.edu/~sih</a>
Originally posted by Ibrahim Hashimi:
[QB]Hi,
I am able to get a response from the server, but it is not the response that I'm looking for. It just returns the same webpage I was viewing.
[ September 21, 2002: Message edited by: raghav mathur ]
Raghav.
Raghav.
Depends on the HTTP method you invoke. A typical HTTP request opens a port to the HTTP server, sends the request header, a newline, and optionally a request body, then reads the response which will again consist of a header and an optional body.Originally posted by raghav mathur:
IN the above examples , the URl have been hardcoded . Suppose it is not then how does one judge whether to write a URL or read from it ?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
Raghav.
No. There is no difference between having a query string or not -- as I said, the method is significant. The GET method does not expect a request body, i.e. it does not expect you to write.Originally posted by raghav mathur:
(1)If the request is using GET (without a query string) that means that the data has to be read from the URL.
(2)If the request is using GET "WITH" a query string that means data has to be writin to a URL .
The proxy would expect the client to write a request body with the POST, so it would capture whatever the client is writing and write that, in turn, to the web server. In the real world, rather than doing this in two discrete steps (read everything from the client, then write it to the server) a proxy would probably stream the write straight through to the remote server. In Java terms, it would write the bytes read from the client InputStream straight into the server OutputStream.Now suppose i have an application which acts as a proxy server [...] Now if the client [uses] "POST" then the proxy application knows that the data has to be writin to the URL. If the client is using POST that means there would be no query string attched to it , then how would the proxy application know what it has to write to the URL?
Peter den Haan | peterdenhaan.com | quantum computing specialist, Objectivity Ltd
No. There is no difference between having a query string or not -- as I said, the method is significant. The GET method does not expect a request body, i.e. it does not expect you to write.
In Java terms, it would write the bytes read from the client InputStream straight into the server OutputStream.
Raghav.
Raghav.
Raghav.
Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters? |