Skip to content

The three download routes

Variable body, transfer file and developer archive. They are not interchangeable, and picking the wrong one is the usual first mistake.

There are three bodies behind one program.

RouteWhat comes backWho wants it
/d/{slug}/rawthe variable bodya client writing straight to a calculator
/d/{slug}the same program as a transfer filea person downloading with a browser
/d/{slug}/libthe developer archivesomeone linking against a library

The same three exist under the API prefix and behave identically:

ShortUnder /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#

GET/d/{slug}/rawPublic

The 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/raw

Do not parse the body to learn what it is. Read the headers:

Response 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-Type
program or appvar.
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-Language
basic, asm or lib.
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#

GET/d/{slug}Public

The 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/snake

The developer archive#

GET/d/{slug}/libPublic

For 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/"
Response headers
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.

Keeping a calculator current

The bulk check that makes this one request for a whole calculator.

Read on
Older versions

Downloading a version that is no longer the newest, and what a withdrawn version answers.

Read on

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.

Rate limits

How the budgets are counted.

Read on
CEagle documentation