InvalidUsage("Failed when parsing body as json") when trying to train

As per the docs one should be able to train rasa with json but I’m having no success. When attempting to post to the training url I keep getting the error - *InvalidUsage(“Failed when parsing body as json”)

I’m using the requests library to post to the url like so

trainer = requests.post('http://localhost:5005/model/train', data=train_data)

I’m certain that train_data is valid json but even when I try the example below taken from the docs

{ "rasa_nlu_data": { "common_examples": [], "regex_features" : [], "lookup_tables" : [], "entity_synonyms": [] } }

it fails too…

Can anyone who has successfully trained with JSON data give me some insight as to why I’m unable to post/train at the endpoint?

Hey @mrcartier

Which version of Rasa Open Source are you using?