Hi, I am calling a nominatim WS through a Java client using this piece of code:

String urls = "http://nominatim.openstreetmap.org/search?q= " + URLEncoder.encode(addressString.trim(), "UTF-8") + "&format=json&polygon=1&addressdetails=1";
URL url = new URL(urls);            
HttpURLConnection uc = (HttpURLConnection) url.openConnection();            
uc.setRequestProperty("Accept-Charset:", "UTF-8");
uc.setRequestProperty("Content-Type:","application/x-www-form-urlencoded;charset=utf-8");

But i got this error:

'406: Not Acceptable' for url: 'http://nominatim.openstreetmap.org/search?q= %CE%A0%CE%91%CE%A1%CE%99%CE%A3%CE%99&format=json&polygon=1&addressdetails=1'

Thanks and best Regards,

asked 05 Aug '15, 09:49

ricard_3's gravatar image

ricard_3
71114
accept rate: 0%

edited 05 Aug '15, 10:36

scai's gravatar image

scai ♦
31.8k19291442


removing the white space after q "q= " has solved the problem. Thanks

permanent link

answered 05 Aug '15, 10:37

ricard_3's gravatar image

ricard_3
71114
accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×572
×7
×2

question asked: 05 Aug '15, 09:49

question was seen: 3,636 times

last updated: 05 Aug '15, 10:37

powered by OSQA