mirror of
https://github.com/hzrd149/blossom.git
synced 2025-12-08 14:58:49 +00:00
Merge pull request #26 from hzrd149/clarify-blob-descriptor
Clarify blob descriptor and add example
This commit is contained in:
16
buds/02.md
16
buds/02.md
@@ -12,13 +12,25 @@ Defines the `/upload`, `/list` and `DELETE /<sha256>` endpoints
|
|||||||
|
|
||||||
A blob descriptor is a JSON object containing `url`, `sha256`, `size`, `type`, and `uploaded` fields
|
A blob descriptor is a JSON object containing `url`, `sha256`, `size`, `type`, and `uploaded` fields
|
||||||
|
|
||||||
- `url` A public facing url this blob can retrieved from
|
- `url` A publicly accessible URL to the [BUD-01](./01.md#get-sha256---get-blob) `GET /<sha256>` endpoint (optionally with a file extension)
|
||||||
- `sha256` The sha256 hash of the blob
|
- `sha256` The sha256 hash of the blob
|
||||||
- `size` The size of the blob in bytes
|
- `size` The size of the blob in bytes
|
||||||
- `type` (optional) The MIME type of the blob
|
- `type` (optional) The MIME type of the blob
|
||||||
- `uploaded` The unix timestamp of when the blob was uploaded to the server
|
- `uploaded` The unix timestamp of when the blob was uploaded to the server
|
||||||
|
|
||||||
Servers may include additional fields in the descriptor like `magnet`, `infohash`, or `ipfs` depending on other protocols they support
|
Servers MAY include additional fields in the descriptor like `magnet`, `infohash`, or `ipfs` depending on other protocols they support
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"url": "https://cdn.example.com/b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553.pdf",
|
||||||
|
"sha256": "b1674191a88ec5cdd733e4240a81803105dc412d6c6708d53ab94fc248f4f553",
|
||||||
|
"size": 184292,
|
||||||
|
"type": "application/pdf",
|
||||||
|
"uploaded": 1725105921
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
## PUT /upload - Upload Blob
|
## PUT /upload - Upload Blob
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user