perkeep/doc/blob-get-protocol.txt

41 lines
866 B
Plaintext

The /camli/<blobref> endpoint returns a blob the server knows about.
A request with the GET verb will return 200 and the blob contents if present, 404 if not. A request with the HEAD verb will return 200 and the blob meta data (i.e., content-length), or 404 if the blob is not present.
Get the blob:
GET /camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 HTTP/1.1
Host: example.com
Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: <the blob length in bytes>
<the blob contents>
Existence check:
HEAD /camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 HTTP/1.1
Host: example.com
Response:
HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Length: <the blob length in bytes>
Does not exist:
GET /camli/sha1-126249fd8c18cbb5312a5705746a2af87fba9538 HTTP/1.1
Host: example.com
Response:
HTTP/1.1 404 OK