[英]Difference between requests.request('POST' and request.post
what would it be the difference between these two sentences: 这两个句子之间有什么区别:
res = requests.request('POST', url)
and 和
res = requests.request.post(url)
They are pretty much the same thing: http://docs.python-requests.org/en/master/_modules/requests/api/#post 它们几乎是同一件事: http : //docs.python-requests.org/en/master/_modules/requests/api/#post
requests.post(…)
is just a wrapper around requests.request('POST', …)
. requests.post(…)
只是requests.request('POST', …)
的包装。 As long as you're using standards methods, the former helps readability and reduces the risk of easily avoidable mistakes, while writing the verb. 只要您使用标准方法,前者就可以在编写动词时提高可读性并减少容易避免的错误的发生。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.