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)