Curl URL¶
curl-url fetches a URL with curl. It fails on HTTP errors (-f) and gives
up after 30 seconds. It is one of the
bundled functions you can use from a button as
it is.
- Runs:
curl -fsSL --max-time 30 {{.url}} url(required): the URL to request
The function file
Add a button¶
Write url directly on the button. Its name matches the parameter declared by
the function.
Check an endpoint
The button runs curl -fsSL --max-time 30 https://example.com/health.
validate reports an error if url is missing.
Related¶
- Parameters — how button values are checked
- Custom functions — all five bundled examples