You often want to send some sort of data in the URL’s query string. If
you were constructing the URL by hand, this data would be given as
key/value pairs in the URL after a question mark, e.g.
httpbin.org/get?key=val. Requests allows you to provide these
arguments as a dictionary of strings, using the params keyword
argument. As an example, if you wanted to pass key1=value1 and
key2=value2 to httpbin.org/get, you would use the following code:
Requests是一个库,允许您使用GET、POST、PUT等请求获取URL。在其中一些服务器上,您可以添加有效负载,或者服务器用来执行某些操作的额外数据。你知道吗
所以负载由服务器处理,但是您必须提供它们,这是通过定义字典来完成的。这完全取决于服务器期望接收的内容。我假设您阅读了以下解释:
这里的有效负载是一个变量,它定义了请求的参数。你知道吗
相关问题 更多 >
编程相关推荐