requests
请求
通过 form-data
发送文件
import requests
POST_HOST = 'http://localhost:3000/upload'
jpg = open('image.jpg', 'rb')
response = requests.post(POST_HOST, files={'image': ('image.jpg', jpg.tobytes())})
响应
读取 Json 响应
import requests
response = requests.get('https://api.github.com/events')
response.json().get('xxx')