File and Dir Operation of Spockfs using cURL
Basic file operation
GET
curl -i http://127.0.0.1:9090/filename
DELETE
curl -i -X DELETE http://127.0.0.1:9090/filename
POST
➜ spockfs curl -i -X POST -H 'X-Spock-mode: 448' http://meihao.us:9090/test.md
HTTP/1.1 201 Created
Content-Length: 0
PUT
➜ ~ curl -i -X PUT -H 'Content-Range: bytes=0-4' -H 'Content-Length: 5' -d 'spock' \
http://meihao.us:9090/test.md
HTTP/1.1 200 OK
Content-Length: 0
RENAME
target is the original name
curl -i -X RENAME -H 'X-Spock-target: todo.org' http://127.0.0.1:9090/todox.org
Basic dir operation
READDIR
curl -i -X READDIR http://127.0.0.1:9090/dir/name/
MKDIR
curl -i -X MKDIR -H ‘X-Spock-mode: 448’ http://127.0.0.1:9090/testmkdir
cURL usage:
echo ‘{“text”: “Hello world!”}’ | curl -d @- https://api.github.com/markdown |
TODO
write a perl backend for it