File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes  response code: 400 from google images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark " response code: 400 from google images" Watch " response code: 400 from google images" New topic
Author

response code: 400 from google images

Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
address = "http://images.google.com/images?q="Arcyptera fusca""


-->


No need to tell, if I put that address into browser it works.
Should that work, I tryed to escape, no effect ?


Searchable nature photo gallery: http://agrozoo.net/jsp/Galery.jsp?l2=en
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 39409
    
  28
Try changing the space to its HTML escape which is something like %20.
Miran Cvenkel
Ranch Hand

Joined: Nov 23, 2010
Posts: 147
Yeah, managed to do it:
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Campbell Ritchie wrote:Try changing the space to its HTML escape which is something like %20.

It's %22 for double quotes.

Miran Cvenkel wrote:Yeah, managed to do it:

You can also use URLEncoder:
Unfortunately there is an UnsupportedEncodingException that can be thrown so you'd need to handle that. However, it's a sub class of IOException, and you probably already have to handle IOException for the rest of the networking code, so that shouldn't be a problem.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: response code: 400 from google images