java - my openConnection() is giving connection refused error -


i writing 1 application needs connect url specified.i getting ip address url http://gmail.com when call openconnection on url giving connection refused error.i connected internet , ran program.still getting connection refused error.when type url in browser giving me connection url. can give me reason.since giving ip address not getting connected.i tried similar google.com ip address getting not connected google still getting connection refused. please me thank you.

try use same user-agent browser.

system.setproperty("http.agent", "mozilla/5.0 (windows nt 6.1) applewebkit/535.1 (khtml, gecko) chrome/14.0.835.186 safari/535.1"); 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -