想知道如何對我的參數進行網址編碼,是嗎?網址編碼參數
params = {'oauth_version': "1.0",
'oauth_nonce': oauth.generate_nonce(),
'oauth_timestamp': int(time.time()),
'oauth_consumer_key': CONSUMER_KEY,
'oauth_token': access_key,
'oauth_nonce' : nonce,
'oauth_consumer_key': consumer.key,
'oauth_signature': 'el078a5AXGi43FBDyfg5yWY',
}
按照這份指南:
To make the Authorization header, you simply append all the values starting with 「OAuth」. Each value must be URL encoded.
> 1. Authorization: OAuth oauth_callback="http%3A%2F%2Fwww.website-tm-access.co.nz%2Ftrademe-callback", > oauth_consumer_key="C74CD73FDBE37D29BDD21BAB54BC70E422", > oauth_version="1.0", oauth_timestamp="1285532322", > oauth_nonce="7O3kEe", oauth_signature_method="HMAC-SHA1", > oauth_signature="5s3%2Bel078a5AXGi43FBDyfg5yWY%3D"
*「這是正確的嗎?」* - ...它工作嗎? – jonrsharpe
可能重複[如何在python中對url參數進行百分比編碼?](http://stackoverflow.com/questions/1695183/how-to-percent-encode-url-parameters-in-python) –
我看到參數,但我不明白你是如何對它們進行URL編碼的。 – jwodder