Page 82 - Python Cơ Bản
P. 82
import requests
payload = {'key1': 'value1', 'key2': 'value2'}
r = requests.get("http://httpbin.org/get", params =
payload)
print(r.url)
(HiӅn thӍ: http://httpbin.org/get?key2=value2&key1=
value1)
6IUYIWX &SH]
8VSRK L϶Y LЎX XVЬRK LвT GɨG VIUYIWX RL 4378 498
XLRK G϶R XVY]АR Hо PMЖY OLM VIUYIWX Gɹ XLВ Wм HдRK XLEQ
WР data чВ XVY]АR HEXE PɱR OɯQ VIUYIWX :ɴ Hд
import requests
payload = {'key1': 'value1', 'key2': 'value2'}
r = requests.post("http://httpbin.org/post", data =
payload)
9TPSEH JMPI