yizhixuepython

http://www.itdiffer.com

http://www.1world0x00.com

 

 

import  requests
print(dir(requests))
r=requests.get("http://www.itdiffer.com")
print(r.cookies)
print(r.headers)
print(r.encoding)
print(r.status_code)
print(r.text)

---
请求发出后 requests会基于http头部对应的编码作出有根据的推测 当你访问r.text requests使用其推测的文本编码
能使用r.coding属性来改变它
-----------
posts向服务器发送请求
----------

import  requests
payload={"key1":"val1","key2":"val2"}
r=requests.post("http://httpbin.org/post")
r1=requests.post("http://httpbin.org/post",data=payload)
print(r)
print("-----")
print(r1)







分类:

技术点:

相关文章:

  • 2021-11-26
  • 2021-11-16
  • 2021-11-16
  • 2021-11-16
  • 2021-11-08
  • 2021-12-15
  • 2021-10-15
  • 2018-02-22
猜你喜欢
  • 2021-12-22
  • 2021-08-29
  • 2021-11-20
  • 2021-11-16
  • 2021-11-16
  • 2021-11-24
  • 2021-11-10
相关资源
相似解决方案