{"id":16937483,"url":"https://github.com/nabijaczleweli/rfsapi-rs","last_synced_at":"2025-04-11T19:13:23.941Z","repository":{"id":57660842,"uuid":"90040539","full_name":"nabijaczleweli/rfsapi-rs","owner":"nabijaczleweli","description":"Raw Filesystem API for Rust -- enable simpler browsing with ease","archived":false,"fork":false,"pushed_at":"2020-04-24T00:09:49.000Z","size":26470,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-11T19:13:17.210Z","etag":null,"topics":["http-client","http-server","rfsapi","rust","web"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nabijaczleweli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"nabijaczleweli","custom":"https://www.paypal.me/nabijaczleweli"}},"created_at":"2017-05-02T14:07:19.000Z","updated_at":"2023-01-06T16:05:21.000Z","dependencies_parsed_at":"2022-09-08T00:11:18.805Z","dependency_job_id":null,"html_url":"https://github.com/nabijaczleweli/rfsapi-rs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabijaczleweli%2Frfsapi-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabijaczleweli%2Frfsapi-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabijaczleweli%2Frfsapi-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nabijaczleweli%2Frfsapi-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nabijaczleweli","download_url":"https://codeload.github.com/nabijaczleweli/rfsapi-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248465344,"owners_count":21108244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["http-client","http-server","rfsapi","rust","web"],"created_at":"2024-10-13T20:59:38.171Z","updated_at":"2025-04-11T19:13:23.923Z","avatar_url":"https://github.com/nabijaczleweli.png","language":"Rust","funding_links":["https://patreon.com/nabijaczleweli","https://www.paypal.me/nabijaczleweli"],"categories":[],"sub_categories":[],"readme":"# rfsapi-rs [![Build status](https://travis-ci.org/nabijaczleweli/rfsapi-rs.svg?branch=master)](https://travis-ci.org/nabijaczleweli/rfsapi-rs) [![Licence](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE) [![Crates.io version](https://meritbadge.herokuapp.com/rfsapi)](https://crates.io/crates/rfsapi-rs)\nRaw Filesystem API for Rust — enable simpler browsing with ease\n\n## [Documentation](https://rawcdn.githack.com/nabijaczleweli/rfsapi-rs/doc/rfsapi/index.html)\n\n\u003c!-- Update relevant sexion in toplevel doc, too --\u003e\n## Format brief\n\nRFSAPI requests are made by setting a GET request's `X-Raw-Filesystem-API` header to `1`\n\nIf the server supports RFSAPI, the response will have its `X-Raw-Filesystem-API` header also set to `1`.\n\nRFSAPI responses do *not* return file contents. Use an undecorated GET instead.\n\nThe response body is a JSON object of type [`FilesetData`](https://rawcdn.githack.com/nabijaczleweli/rfsapi-rs/doc/rfsapi/struct.FilesetData.html) in the following format:\n```js\n{\n  \"writes_supported\": boolean,  // whether the server supports/allows write requests like PUT or DELETE\n  \"is_root\": boolean,           // if this is a top-level directory\n  \"is_file\": boolean,\n  \"files\": Array\u003cRawFileData\u003e\n}\n```\n\nThe [`RawFileData`](https://rawcdn.githack.com/nabijaczleweli/rfsapi-rs/doc/rfsapi/struct.RawFileData.html) objects describe each individual file in a listing:\n```js\n{\n  \"mime_type\": MIME type as string,\n  \"name\": string,                           // filename, no path\n  \"last_modified\": RFC3339 Date as string,\n  \"size\": integer,\n  \"is_file\": boolean\n}\n```\n\n## Examples\n\nGiven the following tree at the root of the server (e.g. [`http`](https://crates.io/crates/https)), running on port 8000:\n```plaintext\n/\n├── a.txt\n├── ndis2-15.6.1.zip\n└── works\n    └── b.txt\n```\n\nThen the metadata of a `curl -v -H \"X-Raw-Filesystem-API: 1\" 127.0.0.1:8000` invocation might look something like this:\n```plaintext\n* Connected to 127.0.0.1 (127.0.0.1) port 8000 (#0)\n\u003e GET / HTTP/1.1\n\u003e Host: 127.0.0.1:8000\n\u003e User-Agent: curl/7.64.0\n\u003e X-Raw-Filesystem-API: 1\n\u003e\n\u003c HTTP/1.1 200 OK\n\u003c Server: http/1.9.2\n\u003c X-Raw-Filesystem-API: 1\n\u003c Content-Type: application/json; charset=utf-8\n\u003c Content-Length: 843\n\u003c Date: Wed, 22 Apr 2020 17:46:51 GMT\n\u003c\n* Connection #0 to host 127.0.0.1 left intact\n```\n\nNote:\n  * The server returned `X-Raw-Filesystem-API: 1`\n  * The server returned `Content-Type: application/json; charset=utf-8`\n\nSo we can be sure that the response body will be an RFSAPI `FilesetData`:\n```json\n{\n  \"writes_supported\": false,\n  \"is_root\": true,\n  \"is_file\": false,\n  \"files\": [\n    {\n      \"mime_type\": \"application/zip\",\n      \"name\": \"ndis2-15.6.1.zip\",\n      \"last_modified\": \"2020-04-13T19:12:22.695457919Z\",\n      \"size\": 31387,\n      \"is_file\": true\n    },\n    {\n      \"mime_type\": \"text/directory\",\n      \"name\": \"works\",\n      \"last_modified\": \"2020-04-22T13:03:33.898025702Z\",\n      \"size\": 0,\n      \"is_file\": false\n    },\n    {\n      \"mime_type\": \"text/plain\",\n      \"name\": \"a.txt\",\n      \"last_modified\": \"2020-04-22T13:02:57.928406978Z\",\n      \"size\": 7,\n      \"is_file\": true\n    }\n  ]\n}\n```\n\nSay we append some data to `a.txt`, or just want to check if it was modified;\n`curl -H \"X-Raw-Filesystem-API: 1\" 127.0.0.1:8000/a.txt` might give us:\n```json\n{\n  \"writes_supported\": false,\n  \"is_root\": false,\n  \"is_file\": true,\n  \"files\": [\n    {\n      \"mime_type\": \"text/plain\",\n      \"name\": \"a.txt\",\n      \"last_modified\": \"2020-04-22T17:55:18.159945230Z\",\n      \"size\": 12,\n      \"is_file\": true\n    }\n  ]\n}\n```\n\nTo see inside the `works` directory we can `curl -H \"X-Raw-Filesystem-API: 1\" 127.0.0.1:8000/works`:\n```json\n{\n  \"writes_supported\": false,\n  \"is_root\": false,\n  \"is_file\": false,\n  \"files\": [\n    {\n      \"mime_type\": \"text/plain\",\n      \"name\": \"b.txt\",\n      \"last_modified\": \"2020-04-22T13:03:33.898026135Z\",\n      \"size\": 13,\n      \"is_file\": true\n    }\n  ]\n}\n```\n\n## Special thanks\n\nTo all who support further development on Patreon, in particular:\n\n  * ThePhD\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabijaczleweli%2Frfsapi-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnabijaczleweli%2Frfsapi-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnabijaczleweli%2Frfsapi-rs/lists"}