5 Requests库主要方法解析

Requests库主要方法解析

 1 """Requests库主要方法解析"""
 2 
 3 
 4 import requests
 5 
 6 kv = {'key1': 'value1', 'key2': 'value2'}
 7 r = requests.request('GET', 'http://python123.io/', params=kv)
 8 # https://python123.io/?key1=value1&key2=value2
 9 print(r.url)
10 
11 body = 'content'
12 r = requests.request('POST', 'http://python123.io', data=body)

 

posted @ 2020-06-04 09:53  udbful  阅读(140)  评论(0编辑  收藏  举报