I need to send data via python post request to service named amplitude, they give curl example, that I tried to rewrite on python and getting 400 error.
curl example
curl --data 'api_key=040062a5d38552315b98302ba4f2f' --data 'identification=[{"device_id":"device_id_of_user", "user_properties":{"Cohort":"Test A"}}]' https://api.amplitude.com/identify
my python code
url = 'https://api.amplitude.com/identify'
data = '{"api_key":"myapi_key", "identification":[{"device_id":"dev_id", "user_properties":{"value1": 26, "value2": 17, "class1": "normal 22+", "class2": "normal2", "class3": "3-7p"}}]}'
r = requests.post(url, data= data)
And as I understand my problem, in curl there is 2 data field and I'm sending only one and I can't find how to send multiple same fields.
The question, is how to make it in the proper way?