FileAdapter¶
::: session_adapters.file_adapter.FileAdapter options: members: - init - close
Operation behavior¶
| Method | Behavior | Typical success status |
|---|---|---|
GET file |
Sets metadata and streams the file | 200 OK |
GET directory |
Directory listing is not implemented | 501 Not Implemented |
HEAD existing path |
Sets modification time and inferred MIME type | 200 OK |
PUT |
Creates parents and writes the request body in text mode | Unset |
DELETE |
Removes a file or recursively removes a directory | Status from the preceding HEAD |
For file responses:
Last-Modifiedis formatted as an HTTP date;Content-Typeis inferred from the path when possible;GETsetsContent-Lengthto the file size;- the response owns and closes the raw file stream.
Missing paths return 404 Not Found. Filesystem permission errors observed by
GET or HEAD return 403 Forbidden; other OSError values return
400 Bad Request.
URL restrictions¶
Only URLs with no hostname or with the hostname localhost are accepted:
See Current limitations for text-mode writes, escaped paths, and deletion behavior.