Skip to content

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

functions/curl-url.yaml
name: curl-url
run: "curl -fsSL --max-time 30 {{.url}}"
params:
  - name: url
    type: string
    required: true
    description: URL to request

Add a button

Write url directly on the button. Its name matches the parameter declared by the function.

Check an endpoint

Check API button
- name: Check API
  type: button
  function: curl-url
  url: "https://example.com/health"

The button runs curl -fsSL --max-time 30 https://example.com/health. validate reports an error if url is missing.