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


          XLš˜RK 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
   77   78   79   80   81   82   83   84   85   86   87