return is reached or the body ends.
Request scripts
A request is a one-off script. You send it to the server, it runs once, and you get its return value back. Requests don’t take parameters.POST /run.
Contract scripts
A contract is a script that’s saved on the server and invoked later, optionally with parameters.- The path is a dot-separated prefix that organizes contracts, like a namespace. Path segments may be any word, including keywords, so
contract if.else.Thingis allowed. - The version is covered in Versioning.
- Parameters are
name: typepairs separated by commas, with an optional trailing comma. Parameter names must be unique. - A contract with no parameters leaves out the parentheses entirely. Writing empty parentheses,
(), is an error.
const variables: you can read them but not reassign them.
Save contracts with POST /contracts. See Contracts for the full workflow.
Return values
Whatever a script returns becomes thereturnValue of the HTTP response, encoded as JSON:
return, or uses a bare return, the return value is null. See JSON encoding for how each type is represented.