mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
we need add http header "Accept:application/json" to get json format file list or we will get a html page
parent
175555c83f
commit
46db3b6b40
|
@ -14,6 +14,7 @@ You can append to any HTTP API with &pretty=y to see a formatted json output.
|
|||
POST /path/to/
|
||||
//return a json format subdirectory and files listing
|
||||
GET /path/to/
|
||||
Accept: application/json
|
||||
```
|
||||
Examples:
|
||||
```bash
|
||||
|
@ -24,7 +25,7 @@ Examples:
|
|||
...
|
||||
> curl -F file=@report.js "http://localhost:8888/javascript/new_name.js" # upload the file with a different name
|
||||
{"name":"report.js","size":866,"fid":"3,034389657e","url":"http://localhost:8081/3,034389657e"}
|
||||
> curl "http://localhost:8888/javascript/?pretty=y" # list all files under /javascript/
|
||||
> curl -H "Accept: application/json" "http://localhost:8888/javascript/?pretty=y" # list all files under /javascript/
|
||||
{
|
||||
"Directory": "/javascript/",
|
||||
"Files": [
|
||||
|
|
Loading…
Reference in a new issue