marcick Well-Known Member Licensed User Longtime User Apr 27, 2020 #1 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: Apr 27, 2020
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 ?
DonManfred Expert Licensed User Longtime User Apr 27, 2020 #2 marcick said: j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0") Click to expand... Try it with B4X: j.GetRequest.SetHeader("User-Agent", "yourpackagenamehere") Does it work? Upvote 0
marcick said: j.GetRequest.SetHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0") Click to expand... Try it with B4X: j.GetRequest.SetHeader("User-Agent", "yourpackagenamehere") Does it work?
marcick Well-Known Member Licensed User Longtime User Apr 27, 2020 #3 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
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".
DonManfred Expert Licensed User Longtime User Apr 27, 2020 #4 marcick said: Do you think is better to specify the full package name (country.company.appname) or just the appname ? Click to expand... I would use the packagename as they are unique. The Appname can be the same on thousands of Apps. Upvote 0
marcick said: Do you think is better to specify the full package name (country.company.appname) or just the appname ? Click to expand... I would use the packagename as they are unique. The Appname can be the same on thousands of Apps.
marcick Well-Known Member Licensed User Longtime User Apr 27, 2020 #5 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
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 ?