return 404 when using Communications.makeImageRequest with this url https://tile.openstreetmap.org/15/16924/11672.png

Hello.

I try to get an url with an application and get 404.

It's not possible to view Http traffic logs  and I don't know why I cant' see it.

When I move this picture to my web server   https://riedid74.fr/15/16924/11672.png

all is good and I display the picture correctly  on the watch.

Is it a restriction to get a picture from  tile.openstreetmap.org

thanks

#######################################################

the code is

        var options = {
           // :palette => [ Graphics.COLOR_WHITE,                     // set the palette
 
           //              Graphics.COLOR_BLACK ],
            :maxWidth => 256,
            :maxHeight => 256,
            :method => Communications.HTTP_REQUEST_METHOD_PUT as Communications.HttpRequestMethod,
            :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_TEXT_PLAIN as Communications.HttpResponseContentType,
            :dithering => Communications.IMAGE_DITHERING_FLOYD_STEINBERG,
            :packingFormat => Communications.PACKING_FORMAT_PNG
        };

        // Make the image request
        Communications.makeImageRequest(url, parameters, options, self.method(:onReceiveImage));
function onReceiveImage(responseCode, data) {

      System.println("function onReceiveImage  response="+ responseCode+ "\n"+data);    
         if (responseCode == 200) {
            image = data;
        } else {
            image = null;
            image = data;
        }

}
 
  • PHP is passing the header from the calling server to any gets it makes using file_get_contents.

    Turns out if I use curl_exec instead I have more control of the headers, and it appears to be picky.

    Just using "Mozilla/5.0" gets a 418 blocked error, but with a whole bogus browser string like "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:15.0) Gecko/20100101 Firefox/15.0.1" it works.

    Is it a restriction to get a picture from  tile.openstreetmap.org

    Back to the OP's problem unless all calls to makeImageRequest go through another server first to clean up the user agent this looks like yet another "won't fix" from Garmin. 

  • That's not what I meant. I was asking if passing a "User-Agent: Foo" header to makeImageRequest is that used when the Garmin server makes the request to the requested url. However now I realized that it doesn't even has an ability to pass headers. Only makeWebRequest has that feature. Still the question is still valid for that method (though only as a curiosity now)

  • However now I realized that it doesn't even has an ability to pass headers

    Someone could submit an enhancement request. I can't get garmin to fix bugs I find, so it should be someone else with a good track record with these.

  • LOL. I don't think such person exists in this forum. But even if they would add it, it'll probably be only added to the newer devices.