req2 = requests.put(url, json = json_data, headers= header)
print(req2.status_code)
print(req2.headers)
Where json_data = req1.json()
url = 'some url'
and
header = {'Content-Type': 'application/data;charset=UTF-16'}
In above code req1 gets a response from a server. req1 json is passed with url to fetch response req2. I want to make req2 using PUT() with charset = utf-16. When I am trying to do this by setting headers of req2 (1st line of code) it doesn't do anything as still the statement print(req2.headers) prints
{'Date': 'Thu, 01 Mar 2018 09:51:00 GMT', 'Transfer-Encoding': 'chunked', 'Content-Type': 'application/json;charset=UTF-8'}