Как я могу изменить длину контента в Python?Python

Программы на Python
Anonymous
Как я могу изменить длину контента в Python?

Сообщение Anonymous »


I want to change Content-Length of my request, as I see by default it's "168". Also I would know what used Content-Length for. Some sites give me net::ERR_CONTENT_LENGTH_MISMATCH (e.g. api sites) so I hope I can fix that and also I would know what is that error (mentioned upper). And do I need to change it or there another way of fixing it?

I tried this but it didn't worked at all:
import requests session = requests.Session() session.headers.update({ "Content-length": "2" }) session.post("https://example.com/")

Источник: https://stackoverflow.com/questions/780 ... -in-python

Вернуться в «Python»