0
votes

I am desgining a web app using google app engine and python and While extracting the form data ie. parameter values using the get request the following error occurs during the runtime:

405 Method Not Allowed

The method GET is not allowed for this resource.

Following is the code: is the get mothos creating problem or is there any other solution to get parameter values.

class PostBody(webapp2.RequestHandler):
        def post(self):
            stringContent=cgi.escape(self.request.get('txtLocation'))
            stringurl='http://maps.googleapis.com/maps/api/place/textsearch/json?query='|stringContent|'&sensor=false&key=mykey'

            result=json.load(urllib.urlopen(stringurl))

            self.response.write(result)

Thanks...

1
Your URL looks malformed. You have an http:// followed by an https and a space before method and your querystring. Is this the correct URL you are trying to get? - Mendhak
ohhh extremely sorry it is typing mistake but the url in the program is correct , there is only one http:// and the problem still prevails.. - Mitul Karnik

1 Answers

1
votes

Try replacing

def post(self)

by

def get(self)