# HTTP headers for API requests
api_headers = {
"User-Agent" : config.get("useragent"),
- "Content-Type": "application/json",
+ "Content-Type": "application/json; charset=utf-8",
}
# Exceptions to always catch
logger.debug("response[]='%s' - CALLED!", type(response))
if not isinstance(response, requests.models.Response):
raise ValueError(f"Parameter response[]='{type(response)}' is not type of 'Response'")
- elif response.headers.get("content-type") != "application/json":
+ elif response.headers.get("content-type").split(";")[0] != "application/json":
logger.warning("response.headers[content-type]='%s' is not a JSON type, below json() invocation may raise an exception", response.headers.get("content-type"))
data = list()