想知道如何对我的参数进行网址编码,是吗?网址编码参数
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