Requests
- The request goes to the endpoint’s
urlwith these parameters in the query string:op(the operation),id(the key’s id) and, depending on the operation,name,sizeandc(the challenge). statusis sent withGET. Every other operation is sent withPOST, which no proxy caches and no client repeats by itself.- Headers:
Host:always; onPOST,Content-Length:, also when it is 0;Authorization:only over HTTPS. The endpoint ignores the request’sContent-Type:. - The body of a
POSTis the file’s content, if the operation has one, followed by the 64-digit signature on the signed route.
Through an HTTPS proxy, the request line carries the full address:
POST https://example.com/publish?op=list&id=anna-1 HTTP/1.0
Replies
- The HTTP status is
200on success,4xxor5xxon errors. - The body is
text/plainASCII with LF line endings:key: valuelines, keys in lowercase, no line longer than 255 characters. - The first line is
status: okorstatus: error. Clients read the reply line by line and ignore keys they don’t know. - An error reply has
error:with one of the codes below andmessage:with a short text for the user.
status: error
error: too-large
message: Files can be at most 16384 bytes.
Error codes
| Code | HTTP | Meaning |
|---|---|---|
bad-request |
400 | a missing or malformed parameter, a wrong Content-Length |
bad-name |
400 | the file name breaks the rules |
bad-type |
415 | the endpoint doesn’t accept this kind of file |
invalid |
422 | the endpoint refused the content |
auth |
403 | an unknown or revoked key, a wrong signature |
expired |
403 | an unknown, used or expired challenge |
insecure-key |
403 | a key was sent over plain HTTP, which is unsafe |
not-found |
404 | no such file |
too-large |
413 | the file is larger than max-size |
quota |
507 | the site is full |
busy |
429 | too many requests; try again later |
server |
500 | anything else |