I am trying to call a callback URL from a python function.
Here is the code:
rasa_url = "http://localhost:5005/webhooks/callback/webhook"
wa_data = {
"sender":"Rasa",
"message":"hi"
}
r = requests.post(url=rasa_url, data=wa_data)
In the terminal of rasa run, I am getting below error:
sanic.exceptions.InvalidUsage: Failed when parsing body as json.
I also tried,
r = requests.post(url=rasa_url, data=json.loads(json.dumps(wa_data)))
How can I solve this?