From 46db3b6b40be496e8cfdc9cbb7dbf0086330168b Mon Sep 17 00:00:00 2001 From: xh_78 Date: Tue, 21 Nov 2017 09:48:58 +0800 Subject: [PATCH] we need add http header "Accept:application/json" to get json format file list or we will get a html page --- Filer-Server-API.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Filer-Server-API.md b/Filer-Server-API.md index 81b9b97..4694fb8 100644 --- a/Filer-Server-API.md +++ b/Filer-Server-API.md @@ -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": [