requests.exceptions.InvalidHeader: Value for header {XX: (‘XX‘,)} must be of type str or bytes, not

requests.exceptions.InvalidHeader: Value for header {
    
    xxx: ('xxx',)} must be of type str or bytes, not <class 'tuple'>

insert image description here
Check whether there is an extra comma (,) after the code; when the value is passed, the comma will become a tuple.

Guess you like

Origin blog.csdn.net/weixin_44949068/article/details/117815304