Skip to content

mav96/SimpleHttpFS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SimpleHttpFS

A simple http API for remote FS

Docs:

Task

Quickstart

git clone https://github.com/mav96/SimpleHttpFS.git
cd SimpleHttpFS
virtualenv env -p python3
source env/bin/activate
pip install -r requirements.txt
python manage.py runserver

Testing http API

We can now access to remote FS using the httpie command line tool...

  • /get Downloads a file:
http -a admin:password123 GET http://localhost:8000/get/readme.txt > readme.txt

Method GET

Returns: The specified file's contents

Errors: 404 The file wasn't found at the specified name


  • /put Uploads a file using PUT semantics.
http -a admin:password123 PUT http://localhost:8000/put/readme.txt < readme.txt

Method PUT, POST

Returns: The metadata for the uploaded file.

Errors: 409 The call failed because a conflict occurred.


  • /update Update file
http -a admin:password123 PUT http://localhost:8000/update/readme.txt < new_readme.txt

Method PUT, POST

Returns: The metadata for the uploaded file.

Errors: 404 The file wasn't found at the specified name


  • /meta Retrieves file metadata.
http -a admin:password123 GET http://localhost:8000/meta/readme.txt

Method GET

Returns: The metadata for the file

Errors: 404 The file wasn't found at the specified name


  • /ls List information about the FILEs
http -a admin:password123 GET http://localhost:8000/ls/

Method GET

Returns: List of metadata entries for any matching files


  • /rm Deletes a file
http -a admin:password123 PUT  http://localhost:8000/rm/readme.txt

Method PUT,POST

Returns: Metadata for the deleted file

Errors: 404 The file wasn't found at the specified name


Links

Django REST framework

A command line HTTP client

About

A simple http API for remote FS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages