mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-11 03:08:50 +01:00
Improve the response status code of kernel API /api/file/getFile (#9075)
* 🎨 Improve the response status code of API `/api/file/getFile`
* refactor: change status code from `204` to `202`
This commit is contained in:
parent
dc3889b5b3
commit
baa3ef0bb4
3 changed files with 41 additions and 7 deletions
19
API.md
19
API.md
|
|
@ -992,7 +992,24 @@ View API token in <kbd>Settings - About</kbd>, request header: `Authorization: T
|
|||
* `path`: the file path under the workspace path
|
||||
* Return value
|
||||
|
||||
File content
|
||||
* Response status code `200`: File content
|
||||
* Response status code `202`: Exception information
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 404,
|
||||
"msg": "",
|
||||
"data": null
|
||||
}
|
||||
```
|
||||
|
||||
* `code`: non-zero for exceptions
|
||||
|
||||
* `-1`: Parameter parsing error
|
||||
* `404`: Not Found (file doesn't exist)
|
||||
* `405`: Method Not Allowed (it's a directory)
|
||||
* `500`: Server Error (stat file failed / read file failed)
|
||||
* `msg`: a piece of text describing the error
|
||||
|
||||
### Put file
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue