測試 jupyter notebook rest api


創建目錄
Method:POST
URL:http://localhost:8888/api/contents
Body/raw: {"type":"directory"}
Response:
{
"created": "2017-09-29T02:27:48.277551Z",
"type": "directory",
"name": "Untitled Folder 2",
"mimetype": null,
"content": null,
"path": "Untitled Folder 2",
"last_modified": "2017-09-29T02:27:48.277551Z",
"format": null,
"writable": true
}

重命名目錄
目錄的名字可以用特殊字符,比如 【】
Method:PATCH
URL:http://localhost:8888/api/contents/Untitled Folder 2
Body/raw: {"path": "my_folder"}
Response:
{
"created": "2017-09-29T02:32:58.825560Z",
"type": "directory",
"name": "my_folder",
"mimetype": null,
"content": null,
"path": "my_folder",
"last_modified": "2017-09-29T02:32:13.525558Z",
"format": null,
"writable": true
}

刪除目錄
刪除之前,目錄不能有文件
Method:DELETE
URL:http://localhost:8888/api/contents/my_folder
Response:204 No Content

創建notebook
Method:POST
URL:http://localhost:8888/api/contents
Body/raw: {"type":"notebook"}
Response:
{
"created": "2017-09-29T02:29:44.445554Z",
"type": "notebook",
"name": "Untitled12.ipynb",
"mimetype": null,
"content": null,
"path": "Untitled12.ipynb",
"last_modified": "2017-09-29T02:29:44.445554Z",
"format": null,
"writable": true
}

重命名notebook
Untitled12.ipynb需存在,11111.ipynb是新文件名
Method:PATCH
URL:http://localhost:8888/api/contents/Untitled12.ipynb
Body/raw: {"path": "11111.ipynb"}
Response:
{
"created": "2017-09-29T02:18:02.593534Z",
"type": "notebook",
"name": "11111.ipynb",
"mimetype": null,
"content": null,
"path": "11111.ipynb",
"last_modified": "2017-09-29T01:37:07.721463Z",
"format": null,
"writable": true
}

刪除notebook
Method:DELETE
URL:http://localhost:8888/api/contents/11111.ipynb
Response:204 No Content


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM