Requests As a json library in v2.9.1
Since the json library functions use only dumps and loads, you can also use other compatible json libraries, such as ujson.
You can switch by overwriting the variable that stores the module as follows:
import requests
import ujson
requests.models.complexjson = ujson
However,
Be careful.
https://github.com/kennethreitz/requests/issues/1595 At that time, the variable name was requests.models.json, but it seems that it was secretly renamed. In the following versions it is named complexjson:
% git tag --contains fb6dade6
v2.8.0
v2.8.1
v2.9.0
v2.9.1
(Although I say that I have to change it without a clear reason, I am worried that it has been changed with an unclear commit message)
Recommended Posts