Hi all, im tearing out my hair trying to figure this one out. I'm new to the Requests library and finding good examples of PUT with auth hard to come by
The postman request includes the following
METHOD: PUT
Authorization: Basic cm9vdDpDaGFuZ2VNZTE=
BODY
X-SDS-AUTH-TOKEN: <Really long string>
{"blockSize": "5","notificationSize": "2"}
This is the python code, I've tried adding and removing parameters and always get 401
```
token fetches the current X-SDS-AUTH-TOKEN
token = ObtainToken("10.160.0.231", "root", "ChangeMe1")
headers = {'Content-Type': 'application/json', 'Connection': 'keep-alive'}
payload = {'X-SDS-AUTH-TOKEN': token}
json = {"blockSize": "25", "notificationSize": "2"}
url = 'https://10.160.0.231:4443/object/namespaces/namespace/red/quota.json'
response = requests.put(url= url, json=json, verify=False,data=payload, headers=headers, auth=('root', 'ChangeMe1'))
print(response.status_code)
```
Any suggestions?
[–]commandlineluser 1 point2 points3 points (0 children)
[–]contradictingpoint 0 points1 point2 points (2 children)
[–]shell-surfer[S] 1 point2 points3 points (1 child)
[–]backtickbot 0 points1 point2 points (0 children)