DEV Community

Discussion on: Using Elasticsearch with Python and Flask

Collapse
 
kamilliano profile image
kamilliano

Hi, I didn't follow the code nor run it locally. But from what you describe is that when you hit 127.0.0.1:5000/insert_data you invoke GET request and that route only accepts POST so you get not allowed error. You probably would need to do curl -H 'Content-Type: application/json' -X PUT -d '[JSON]' http://127.0.0.1:5000/insert_data where JSON is your data matching your es schema.