wood burning stoves 2.0*
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
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: 38481
    
  23
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: 19680
    
  19

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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: response code: 400 from google images