Код Curl работает Python не
пытается перейти с curl на python
curl --location --request PUT "https://api.getpostman.com/environments/XXXXX-YYYYYY-ZZZZ-BBBB-AAAA-ZZZZZZ?apikey=12334567890" \ --header "Content-Type: application/json" \ --data "{ \"environment\": { \"values\": [ {\"key\": \"url\", \"value\": \"http://10.12.30.131\"} ] } }" import requests import json url = 'https://api.getpostman.com/environments/XXXXX-YYYYYY-ZZZZ-BBBB-AAAA-ZZZZZZ?apikey=12334567890' header = {"Content-type": "application/json"} body = '{\"environment\": { \"name\": \"Prod - Deploy\", \"values\": [ {\"key\": \"url\", \"value\": \"http://10.12.30.131\"}]}}' response = requests.put(url, data=json.dumps(body), headers=header) print(response.status_code) print(response.text)
ожидайте ответа 200
тело должно быть body = '{"environment \": {"name \": "Prod - Deploy \", "values \": [{"key \": "url \", "value \" : "http://10.12.30.131\"}, {" key \ ":" appPath \ "," value \ ":" footytips-apis-v1 \ "}]}} '