There are three bodies behind one program.
| Route | What comes back | Who wants it |
|---|---|---|
/d/{slug}/raw | the variable body | a client writing straight to a calculator |
/d/{slug} | the same program as a transfer file | a person downloading with a browser |
/d/{slug}/lib | the developer archive | someone linking against a library |
The same three exist under the API prefix and behave identically:
| Short | Under /api/v1 |
|---|---|
/d/{slug}/raw | /api/v1/programs/{slug}/download |
/d/{slug} | /api/v1/programs/{slug}/download.8xp |
/d/{slug}/lib | /api/v1/programs/{slug}/library.zip |
All six mean the newest published version. Put /v/{version} after the address to pin an older
one: /d/snake/v/1.1.0 is the transfer file of exactly that version, and /raw and /lib hang off
it the same way.
The variable body#
/d/{slug}/rawPublicThe bytes to write to the calculator, with no transfer-file wrapper around them. This is what Swoop fetches.
curl -sD - -o SNAKE.bin https://roost.ceagle.cc/d/snake/rawDo not parse the body to learn what it is. Read the headers:
X-CEagle-Slug- The address this body belongs to.
X-CEagle-Var-Name- The name to give the variable on the calculator.
X-CEagle-Var-Typeprogramorappvar.X-CEagle-Var-Size- The body length in bytes, as a decimal string.
X-CEagle-Var-Archived- Whether the program wants to live in archive memory.
X-CEagle-Languagebasic,asmorlib.X-CEagle-Checksum- A digest of this body. Compare before re-downloading.
X-CEagle-Depends- Comma-separated addresses this program names. Absent when it has none.
Every fetch counts as a download.
The transfer file#
/d/{slug}PublicThe same program wrapped as a file a computer sends to a calculator: an .8xp for a program, an
.8xv for an appvar. Content-Disposition carries a sensible filename with the right extension.
curl -sOJ https://roost.ceagle.cc/d/snakeThe developer archive#
/d/{slug}/libPublicFor a LibLoad library only. A zip holding the appvar, the .lib stub and the public headers, flat
and named by their base names.
curl -sOJ https://roost.ceagle.cc/d/demo-library/lib
unzip demo-library-1.0.0.zip
cp DEMO.lib "$CEDEV/lib/libload/"
cp demo.h "$CEDEV/include/"X-CEagle-Library- The LibLoad name inside the archive.
X-CEagle-Checksum- A digest of the archive.
Content-Disposition- An attachment name of
slug-version.zip.
A program that is not a library answers 404 here.
Caching#
Every download answers Cache-Control: no-store, because the body behind an address changes when a
new version is published and a stale copy would be written to somebody's calculator.
Use the checksum rather than an HTTP cache. It is on the program record, on every requirement entry, in the bulk version check and in the download headers, precisely so a client can decide not to download without asking for the body.
The bulk check that makes this one request for a whole calculator.
Downloading a version that is no longer the newest, and what a withdrawn version answers.
Rate limits#
Downloads have their own budget, separate from the read budget on the JSON endpoints. A client that fetches metadata often and bodies rarely will not notice it.
How the budgets are counted.