# HTTP 405 when accessing Contents API from DataSpell

**URL:** <https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820>\
**Category:** Zero to JupyterHub on Kubernetes\
**Created:** [January 31, 2022, 2:43pm UTC](https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820 "2022-01-31T14:43:18Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gdubya](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gdubya/32/6163_2.png) [@gdubya](https://discourse.jupyter.org/u/gdubya)\
**Post date:** [January 31, 2022, 2:43pm UTC](https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820/1 "2022-01-31T14:43:18Z")

</div>

We are testing connecting to Jupyterhub on Kubernetes using DataSpell, but it looks like the API URLs aren’t quite as expected.

For example, the “configured server” in DataSpell is:  
[https://jupyterhub.myhost.com/?token=mysecretusertoken](https://jupyterhub.myhost.com/?token=mysecretusertoken)

Then when i create a file in DataSpell a 405 appears in the DataSpell logs:

2022-01-31 15:18:27,978 [1949333] ERROR - intellij.openapi.progress.Task - Error with connection to Jupyter: server responded with 405 on Request(method=PUT, uri=https://jupyterhub.myhost.com/api/contents/test.py-upload-24SzJvvFWJ50kWwMu5b0XZPDUyH, headers=[(Content-Type, application/json; charset=UTF-8)], body=java.io.ByteArrayInputStream@53c27d49, context=Context(mayInteractUi=true)). [200, 201] was expected.

Is it possible to connect to a Jupyterhub pod using an external IDE or am I barking up the wrong tree?

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [February 6, 2022, 6:01pm UTC](https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820/2 "2022-02-06T18:01:38Z")

</div>

I’m not familiar with DataSpell, but it’s possible to access the jupyter-server API on JupyterHub. For example:

```auto
$ curl localhost:8000/user/demo/api/contents -H 'Authorization: token <token>'

{"name": "", "path": "", "last_modified": "2022-02-06T17:30:11.565506Z", "created": "2022-02-06T17:30:11.565506Z", "content": [], "format": "json", "mimetype": null, "size": null, "writable": true, "type": "directory"}

```

This assumes your jupyter-server is already running.

---

<div class="post-metadata">

**Author:** ![gdubya](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/gdubya/32/6163_2.png) [@gdubya](https://discourse.jupyter.org/u/gdubya)\
**Post date:** [February 7, 2022, 8:23am UTC](https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820/3 "2022-02-07T08:23:12Z")

</div>

Thanks manics. I was hoping the API was just automatically compatible with whatever Dataspell expects in order to be able to share the notebook with the IDE. haha.

Do you have experience / recommendations for using any other external tools to sync with Jupyterhub on Kubernetes? Some of our users prefer using an external IDE instead of notebooks-in-a-browser.

---

<div class="post-metadata">

**Author:** ![manics](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.jupyter.org/manics/32/85_2.png) [@manics](https://discourse.jupyter.org/u/manics)\
**Post date:** [February 7, 2022, 2:36pm UTC](https://discourse.jupyter.org/t/http-405-when-accessing-contents-api-from-dataspell/12820/4 "2022-02-07T14:36:11Z")

</div>

I don’t, I usually use JupyterLab for editing notebooks 🙂
