Use ujson in requests

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.

References

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

Use ujson in requests
Use config.ini in Python
Use dates in Python
Use Mean in DataFrame
Use Valgrind in Python
Use profiler in Python
Let's use def in python
Use "$ in" operator with mongo-go-driver
Use let expression in Python
Use Anaconda in pyenv environment
Use parameter store in Python
Use regular expressions in C
Use MongoDB ODM in Python
Use list-keyed dict in Python
Use Random Forest in Python
Use regular expressions in Python
Use Spyder in Python IDE
Use Juman ++ in server mode
ยท Address already in use solution
Use <input type = "date"> in Flask
Use jinja2 template in excel file
Use optinal type-like in Go language
Use fabric as is in python (fabric3)
Mock in python-how to use mox
How to use Requests (Python Library)
How to use SQLite in Python
Handle requests in a separate process
Use rospy with virtualenv in Python3
Use API not implemented in twython
How to use Mysql in python
Use Python in pyenv with NeoVim
How to use ChemSpider in Python
How to use PubChem in Python
Use django-debug-toolbar in VirtualBox / Vagrant environment
Use OpenCV with Python 3 in Window
requests
How to use calculated columns in CASTable
Use the type features evolved in Sphinx-2.4
Use print in a Python2 lambda expression
Use of constraints file added in pip 7.1
In gunicorn (> = 19.2), use max_requests_jitter along with max_requests
Use tensorflow in an environment without root
Easily use your own functions in Python
Use a scikit-learn model trained in PySpark
How to use Google Test in C
Resolve the Address already in use error
Log in to Slack using requests in Python
Easy way to use Wikipedia in Python
Minimum knowledge to use Form in Flask
Get query parameters for GET requests in Django
Use cartopy without bugs in Google Colaboratory
How to use Anaconda interpreter in PyCharm
R: Use Japanese instead of Japanese in scripts
Don't use \ d in Python 3 regular expressions!
How to use __slots__ in Python class
Use the command previously entered in IDLE
Use pathlib in Maya (Python 2.7) for upcoming Python 3.7
Use Python3's Subprocess.run () in a CGI script
How to use regular expressions in Python
Call APIGateWay with APIKey in python requests
How to use Map in Android ViewPager