Response’ object is not subscriptable Python http post request

The response object contains much more information than just the payload. To get the JSON data returned by the POST request, you’ll have to access response.json() as described in the example:

requestpost = requests.post(url, json=data, auth=(username, password))
response_data = requestpost.json()
print(response_data["requestId"])

Leave a Comment