import json
import requests
payload = {"projectID": 44100,"projectName": "AutomationTest","clientName": "Automation","awsRegion": "Automation_Test","environment": "Dev","active": True,"clustered": False,"measurementTypesJson": "[Automation]"}
files = {
'projectInfo': (None, json.dumps(payload), 'application/json'),
'logo': (open('tiff-icon-40517.jpeg', 'rb'), 'multipart/form-data')
}
url = "passing my url here"
headers = {
'Authorization': "passing auth token here"
}
print(files)
response = requests.request("POST", url, data=files, headers=headers)
print(response)
响应-415
我也尝试过将徽标/图像类型更改为image / jpeg和application / octet-stream,但是没有用