jupyter_server
jupyter_server copied to clipboard
Path ambiguity for POST /api/contents/path
Description
When creating a new file, jupyter-server seems to get the path from the URL of the POST request: /api/contents/path.
But path is also provided in the body of the request, at least for a JupyterLab request:
{
"path": "tmp",
"type": "file",
"ext": ".txt"
}
And jupyverse gets the path from the body.
It seems ambiguous to send the apparently same information in two different places. Should we keep only one place? If so, which one?
Reproduce
- Launch JupyterLab.
- Create a new file in directory
tmp. - See in the browser's network analyzer a POST request to
/api/contents/tmp, with body{"type":"file","path":"tmp","ext":".txt"}.
Expected behavior
Have the path either in the URL or in the body.