I am trying to send post request in flask.
I'd like to send json object with Content-Type: application/json
set as a header.
I'm doing this with requests module as follows:
json_fcm_data = {"data":[{'key':app.config['FCM_APP_TOKEN']}], "notification":[{'title':'Wyslalem cos z serwera', 'body':'Me'}], "to":User.query.filter_by(id=2).first().fcm_token}
json_string = json.dumps(json_fcm_data)
print json_string
res = requests.post('https://fcm.googleapis.com/fcm/send', json=json_string)
But this gives me:
TypeError: request() got an unexpected keyword argument 'json'
Any advices on how to fix this?