This is similar to the Facebook API - the query string should be normalized before generating the signature hash.
You probably have a dictionary of options like:
params = { 'consumer_key': "....", 'consumer_secret': "....", 'timestamp': ..., ... }
Create a query string as follows:
urllib.urlencode(sorted(params.items()))
params.items() returns the keys and values ββof the dictionary as a list, sorted() sorts the list, and urllib.urlencode() combines them into one line during escaping.
a paid nerd
source share