From 83ab3966d1e08b9c35c6d9fb15425d5e0766d46e Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 27 Sep 2018 01:11:16 -0700 Subject: [PATCH 1/2] do not use PUT for uploading files --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 438bd74c8..eb6463eb5 100644 --- a/README.md +++ b/README.md @@ -114,14 +114,14 @@ To upload a file: first, send a HTTP POST, PUT, or GET request to `/dir/assign` {"count":1,"fid":"3,01637037d6","url":"127.0.0.1:8080","publicUrl":"localhost:8080"} ``` -Second, to store the file content, send a HTTP multi-part PUT or POST request to `url + '/' + fid` from the response: +Second, to store the file content, send a HTTP multi-part POST request to `url + '/' + fid` from the response: ``` -> curl -X PUT -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6 +> curl -F file=@/home/chris/myphoto.jpg http://127.0.0.1:8080/3,01637037d6 {"size": 43234} ``` -To update, send another PUT or POST request with updated file content. +To update, send another POST request with updated file content. For deletion, send an HTTP DELETE request to the same `url + '/' + fid` URL: From b5f3578fe4847237042cb21244c01aa42b8eed38 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Thu, 27 Sep 2018 01:13:22 -0700 Subject: [PATCH 2/2] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index eb6463eb5..1da5158da 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ SeaweedFS uses HTTP REST operations to write, read, delete. The responses are in To upload a file: first, send a HTTP POST, PUT, or GET request to `/dir/assign` to get an `fid` and a volume server url: ``` -> curl -X POST http://localhost:9333/dir/assign +> curl http://localhost:9333/dir/assign {"count":1,"fid":"3,01637037d6","url":"127.0.0.1:8080","publicUrl":"localhost:8080"} ``` @@ -186,7 +186,7 @@ http://localhost:8080/3/01637037d6.jpg?height=200&width=200&mode=fill SeaweedFS applies the replication strategy at a volume level. So, when you are getting a file id, you can specify the replication strategy. For example: ``` -curl -X POST http://localhost:9333/dir/assign?replication=001 +curl http://localhost:9333/dir/assign?replication=001 ``` The replication parameter options are: