I tried to send an xml to an url its ,
throwing error when its tries to opens connection to the URL (url.openStream())
URL url = new URL("http://xx/yy?xml=test xml");
connection.setDoOutput(true);
connection.setDoInput(true);
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));
But when i tried to connect to the url directly from the browser i could able to connect.Only through the code i'm getting the error.
HTTP is a request-response protocol. Many servers will not start to process a request until the client opens the response. Try reading from your BufferedReader.
That's because url.openStream() is shorthand for url.openConnection().getInputStream() - and therefore does not use the proxy. In my code example I've shown you to use connection.getInputStream() instead.
Neeba Rebbaca
Ranch Hand
Joined: Oct 21, 2008
Posts: 116
posted
0
How to get the proxy address dynamically.Because if i put the code in some other system the proxy may change.