Android Question Problem in Nominatim geocoding service

marcick

Well-Known Member
Licensed User
Longtime User
Hi all,
I'm using since two years the Nominatim free service from OSM project to obtain a street address from a couple of coordinates.
A sample is described here
Recently I have some problems ("access blocked") and I wrote to their support.
They told me "Is it possible that you send some of your request without the customized user agent? Then please change your code to always send your applications name as required per our usage policy".

I suppose I have to set the User-Agent header, as explained here adding this line after the job.download

B4X:
j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0")

Question is: Am I sending with this line of code the "application name" as they require ? Or just a generic header ?

I'm not sure to understand, because I'm not actually using the SetHeader but they say "all requests with a user agent from (my app name) have been successful according to our logs. How can they see my app name in the request ?
 
Last edited:

DonManfred

Expert
Licensed User
Longtime User
j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0")
Try it with
B4X:
j.GetRequest.SetHeader("User-Agent", "yourpackagenamehere")
Does it work?
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
Well, actually it started to work again without any code modification from my side.
I don't know if they "unlocked" me after my email.
Anyway I tried as you suggest and it works the same, so I'll publish this update and see.

Do you think is better to specify the full package name (country.company.appname) or just the appname ? Because they say "please change your code to always send your aplications name as required per our usage policy".
 
Upvote 0

marcick

Well-Known Member
Licensed User
Longtime User
I'll do it, thanks.
But to understand better: because I don't actually have the header, how can they say "all requests with a user agent from '(my appname)' have been successful according to our logs" ?
Is the OkHTTPUtils2 library that automatically add something to the requests ?
 
Upvote 0
Top