Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def on_post(self, req, resp):
- response = dict()
- try:
- data = simplejson.load(req.stream.read().decode("utf-8"))
- logger.info(data)
- mapUrl = req.get_params("url", None)
- response['url'] = add_google_key(mapUrl)
- resp.status = falcon.HTTP_200
- resp.body = simplejson.dumps(response)
- except Exception, ex:
- response['error'] = "Error occured"
- resp.status = falcon.HTTP_400
- resp.body = simplejson.dumps(response)
- return resp
- POST /add HTTP/1.1
- Host: 127.0.0.1:8000
- Content-Type: application/json
- Cache-Control: no-cache
- {
- "url": "www.google.com"
- }
Add Comment
Please, Sign In to add comment