HTTP with a saved endpoint
Send a POST request with a JSON body built from earlier output. Time: 15 minutes. Needs: a saved HTTP endpoint named Create message that accepts {"message": "..."}.
Steps
- Add an HTTP endpoint block and choose your saved endpoint in Properties. Its path parameters, query string, headers, and payload are copied onto the block.
- Build the request body in a Code block first. Don’t put text between JSON quotes in a template, because quotes and newlines in user input would break the JSON.
Don’t do this: body: '{"message":"{{ steps.echo.message }}"}'. If the message is She said "hi", the result is invalid JSON. Serialise the whole body in code and insert it as one value.
Credentials
The endpoint’s saved credentials stay in the OS keychain and are read during credential preflight, before the run starts. macOS decides whether to show a Keychain prompt. Cancel run is available while preflight is in progress. To use a secret directly, declare it under secrets: and use it in a header template such as {{ secrets.API_TOKEN }}. Termorq masks it in the record.
On Runs, the send_http row shows the resolved request and status (for example 201). steps.send_http.body holds the response.
Add a Decision after send_http that goes to a log_failure block when steps.send_http.status isn’t 201. (Decisions are covered in Stage 5.)