jupyter_server icon indicating copy to clipboard operation
jupyter_server copied to clipboard

Path ambiguity for POST /api/contents/path

Open davidbrochart opened this issue 3 years ago • 0 comments

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

  1. Launch JupyterLab.
  2. Create a new file in directory tmp.
  3. 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.

davidbrochart avatar Apr 04 '22 13:04 davidbrochart