pythonimport requests
url = 'http://www.baidu.com'
headers = {'Content-Type': 'application/json'}
r = requests.get(url, headers=headers)
print r.headers['Content-Type']
輸出的內(nèi)容為text/html; charset=utf-8 而不是我設(shè)置的application/json
何解?
BTW python2.7.9
requests庫無法設(shè)置headers
料青山看我應(yīng)如是
2019-02-21 05:15:33