课程视频地址:
https://edu.csdn.net/course/detail/28645

Requests库的post方法

Requests库的post()方法主要用于向HTTP网页提交post请求,相当于HTTP的POST。这里,我们给指定的url地址http://httpbin.org用post()方法添加sendmsg信息,示例代码如下:
【四二学堂】Requests库的post方法
【四二学堂】Requests库的post方法
可以看出,字典sendmsg以form表单的形式被发送给response对象。
发送字符串示例代码如下:

【四二学堂】Requests库的post方法
【四二学堂】Requests库的post方法
从代码的交互式输出结果不难看出,字符串以键值对被保存下来。

相关文章:

  • 2021-11-03
  • 2022-12-23
  • 2021-04-26
  • 2021-04-06
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2021-10-05
猜你喜欢
  • 2021-05-17
  • 2021-07-29
  • 2021-08-27
  • 2022-12-23
  • 2021-06-20
  • 2021-05-30
  • 2022-12-23
相关资源
相似解决方案