w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
AttributeError: 'tuple' object has no attribute 'startswith' when using Python httplib

You're passing a tuple instead of a string:

>>> sig = 'sig'
>>> 'oauth/token?blahblah&' + 'sig=%s', sig
('oauth/token?blahblah&sig=%s', 'sig')
>>> 'oauth/token?blahblah&' + 'sig=%s' % sig

Replace the following line:

token_url = "oauth/token?" + urlencode(ksort(params)) +


token_url = "oauth/token?" + urlencode(ksort(params)) +

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.