4

I'm using Chalice to build a fairly straightforward API on AWS Lambda & API Gateway.

I need a way to get access to the raw query string (i.e foo=bar&abc=123). When accessing the app.current_request.query_params dictionary, it's already been processed, such that any empty parameters (foo=&bar=) have been stripped out.

Unfortunately I'm working with a third-party API that sends a signed hash value in the query string, based off the raw query string. I can't verify it without the original, unaltered query string. Is there any way to access it other than current_request.query_params?

robmathers
  • 3,028
  • 1
  • 26
  • 29

1 Answers1

0

If you wish to get everything you do the following.

Let's say you are hitting the route /objects/{what}?human=you&thing=computer

@app.route('/objects', methods=['GET'])
def myobject(what):
    everything = app.current_request.to_dict()
    print("look at me: {}".format(params))
    

For more information see: Request from the Chalice docs

Gino Mempin
  • 25,369
  • 29
  • 96
  • 135
Ali Payne
  • 159
  • 1
  • 6