pyzabbix
pyzabbix copied to clipboard
Do not sent correct Content-Type
zapi = ZabbixAPI("http://zb.relef.ru/zabbix")
In zapi.session.headers
"Content-Type"
sending by python client is "text/html", but method update do not help for this
zapi.session.headers.update(
{
"Content-Type": 'application/json',
"User-Agent": "python/pyzabbix",
"Cache-Control": "no-cache",
}
)
zapi.session.header
afte it return as
{'User-Agent': 'python/pyzabbix', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json', 'Cache-Control': 'no-cache'}
But in nginx access log I see this ..., "Content-Type":"text/html",
And I get error 412 for zabbix API, because ```Content-Type`` in nginx log recieved as ```"text/html"```
$ python -V Python 3.8.17