![Python Automation Cookbook](https://wfqqreader-1252317822.image.myqcloud.com/cover/411/36699411/b_36699411.jpg)
上QQ阅读APP看书,第一时间看更新
How it works...
requests directly accepts to send data in the proper way. By default, it sends the POST data in the application/x-www-form-urlencoded format.
Compare that with the Accessing web APIs recipe, where the data is explicitly sent in JSON format using the argument json . This makes the Content-Type be application/json instead of application/x-www-form-urlencoded .
The key aspect here is to respect the format of the form and the possible values that can return an error if incorrect, typically a 400 error.