This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Java in General and the fly likes HttpUrlConnection is not working Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

HttpUrlConnection is not working

enkhbat dash
Greenhorn

Joined: Aug 12, 2008
Posts: 11
When I copy and paste http://www.google.com/search?q=test in address bar, it works perfectly. But when I using HttpUrlConnection to connect it, it doesn't work. Here is my code.




When I copy and paste link to address bar, it's accessing web via get method right? And code uses get method, too. Any suggestion and help?


Be nice!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61450
    
  67

Please do not cross-post the same question in multiple forums. It wastes people's time when multiple redundant conversations take place. Please read this for more information.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
Consider Paul's rocket mass heater.
 
subject: HttpUrlConnection is not working