PyWorkflowApp / visual-programming

A Python Visual Programming Workspace for Data Science
MIT License
33 stars 12 forks source link

Change open/save endpoints to POST #27

Closed reelmatt closed 4 years ago

reelmatt commented 4 years ago

Changes the 'open' and 'save' endpoints from GET -> POST requests. Loads/stores JSON according to:

{
    react: {react-diagrams JSON},
    networkx: {networkx graph as JSON},
}

Open route has options for Django receiving a file upload (file = request.FILES; json.load(file)) and for receiving raw JSON (json.loads(request.body)). We can probably settle on one; wasn't sure which was the best approach. The FileStorage is now not really used—the uploaded file is parsed in memory. We may want to revisit this and save before parsing.