Hi, I notice GAE includes a "referer" property into the header when sending a fetch request mapsapi. Could this be the reason why maps api is returning malformed/illegal requests?
On Dec 31, 11:14 am, nicklv <[email protected]> wrote: > Hi, > > I was wondering if anyone is fetching from staticmap from GAE? > I'm fetching from google staticmap and getting malformed or illegal > request reply. > > Below is a snippet of my code. My only guess is that it could be a > problem with > the api key - it contains '-'. Should I escape it? > > Appreciate anyone could show some pointers. > > urlfields = { 'center': str(rlat) + ',' + str(rlon), > 'zoom' : str(defzoom), > 'size' : str(defsize) + 'x' + str(defsize), > 'maptype': 'mobile', > 'key': mapapikey, > 'sensor': 'false', > 'markers': str(rlat) + ',' + str(rlon) > } > url = server+ urllib.urlencode(urlfields) > imagemap = urlfetch.fetch(url) > if imagemap.status_code == 200: > self.response.headers['Content-Type'] = 'image/gif' > self.response.out.write(imagemap.content) > else: > logging.debug('Response code != 200') > self.response.headers['Content-Type'] = 'text/html' > self.response.out.write(imagemap.content) --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google App Engine" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/google-appengine?hl=en -~----------~----~----~----~------~----~------~--~---
