• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

python requests json/data/params 参数的区别

互联网 diligentman 1周前 (11-21) 7次浏览

To answer my own question, it appears my two examples above do the same thing and that using the json parameter does indeed set the content-type in the headers to application/json. In my first example above using the data parameter, the content-type in the headers would need to be set manually.

 参考:
https://stackoverflow.com/questions/26685248/difference-between-data-and-json-parameters-in-python-requests-package

喜欢 (0)