我正在寻找一种在 python 中使用邮递员片段来解析多个 API 请求的方法。
以下作品:
import http.client
conn = http.client.HTTPSConnection("webapi.teamviewer.com")
payload = "remotecontrol_id=rxxxxxxxx&groupid=g18932019&alias=test1%20api&password=xxxxxx"
headers = {
'authorization': "Bearer xxxxxxx-xxxxxxxxxxx",
'cache-control': "no-cache",
'postman-token': "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxx",
'content-type': "application/x-www-form-urlencoded"
}
conn.request("POST", "/api/v1/devices", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
如何使用多个有效负载执行此操作。?