Hello Rajapandian,
Rajapandian R wrote:
> i use ie http analyser and get the required informations and i set all
> the request headers and i give the required form values .
> i checked the cookie values,every thing is right, the response is 200
> ok,but the content length is zero.i have pasted the code below.
> please have a look and suggest me some ideas.
> homepage.setRequestHeader("Host","www.goair.in");
> homepage.setRequestHeader("Connection","Keep-Alive");
These headers are controlled by HttpClient. DON'T SET THEM!
In particular not the Host header, the other one is less problematic.
> searchresult.setRequestHeader("Request-Line","POST/besr_availability.aspx
> HTTP/1.1");
You can't be serious about this one. If you used an HTTP analyzer to
compare the requests sent by HttpClient and the browser, didn't you
notice the difference? Please compare the requests again, and make
sure that the one from HttpClient doesn't send any more garbage.
Also, have a quick look into RFC 2616 to learn the difference between
a header and a request line: http://www.ietf.org/rfc/rfc2616.txt
There are also nice PDF versions of this RFC if you search for them.
> searchresult.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
> searchresult.setRequestHeader("Host","goair.in");
> searchresult.setRequestHeader("Connection","Keep-Alive");
These headers are controlled by HttpClient. DON'T SET THEM!
In particular not the Host and Content-Type headers. The
other one is less problematic.
> [snipped more code]
And so on. I'm not here to debug your application. Please tell me about
status codes and headers you get or do not get. I have no intention
whatsoever of setting up an environment for running your code to get
that data myself.
In a second mail, you wrote:
> So i tried it with some intervals, I get the expected result page
> some times and i am not getting it some times.
> I am not getting the required page consistantly.
What's the value of the Content-Length, Content-Type, Transfer-Encoding
headers if you do or do not get the result page? You can try to put some
delay into your application between the requests. A user with a browser
doesn't click with response times in the milliseconds range. Maybe the
site has some protection against DoS attacks. You can also try to enable
the expect-continue handshake for the POST request(s).
http://jakarta.apache.org/commons/httpclient/performance.html#Expect-continue%20handshake
hope that helps,
Roland
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]