Bootstrap

python如何传递body参数

 

Python给接口传body参数的话可能需要对将body参数转换成json形式

import json

 

headers = {'content-type': "application/json"}

response = requests.post(url, data = json.dumps(body), headers = headers)

headers获取如图:

;