-3
我有一個這個示例程序,但目前它不顯示發佈數據。使用Python請求查看POST數據模塊
import requests
r = requests.post('https://requestb.in/12p8nqo1',data={'key':'value'})
print(r.text)
。 >>>'ok'
爲什麼不打印「key:value」?
感謝
我有一個這個示例程序,但目前它不顯示發佈數據。使用Python請求查看POST數據模塊
import requests
r = requests.post('https://requestb.in/12p8nqo1',data={'key':'value'})
print(r.text)
。 >>>'ok'
爲什麼不打印「key:value」?
感謝
要訪問您必須處理底層PreparedRequest對象的請求數據,就像這樣:
import requests
r = requests.post('https://requestb.in/12p8nqo1',data={'key':'value'})
print(r.request.body)
爲什麼要這樣? – e4c5
將瀏覽器指向https://requestb.in/12p8nqo1並查看頁面源代碼。願啓蒙來臨。 –