Run curl
step
Makes an API call and returns the status code + response body
Specification
method
Required
string
The http method to use
url
Required
string
The url to make the call to
file
Optional
string
The optional file to use as a body. Can be a public url or a file from a git repository
filevars
Optional
object
The optional keys to replace in the file body
body
Optional
object
The optional keys and values to add to the request body
headers
Optional
object
The optional headers to add to the request
query
Optional
object
The optional query parameters to add to the request
expects
Optional
array
The optional http code(s) required for the step to succeed
failon
Optional
array
The optional http code(s) that will always make the step fail
git
Optional
object
A git repository containing the file for the request body
git.
connection
Optional
A Relay SSH connection to useConnection docs
${connections.ssh.my-ssh-connection}
git.
name
Required
string
A directory name for the git clone.
git.
branch
Optional
string
The Git branch to clone.
git.
repository
Required
string
The git repository URL.
Outputs
code
Required
string
The numeric http code
response
Required
string
The response body
Example workflow configuration
steps:
- name: GetRandomString
image: relaysh/stdlib-step-curl
spec:
method: GET
url: https://random.justyy.workers.dev/api/random/
expects:
- 200
query:
n: 32
x: 1
Example workflow configuration
parameters:
workspace:
description: The Talend workspace to use
environment:
description: The Talend environment to use
name:
description: The name of the new remote engine
steps:
- name: CreateRemoteEngine
image: relaysh/stdlib-step-curl
spec:
url: https://api.eu.cloud.talend.com/tmc/v1.3/runtimes/remote-engines
expects:
- 200
- 201
headers:
Content-Type: application/json
Accept: application/json
Authorization: ${secrets.auth}
body:
name: ${parameters.name}
environmentId: ${parameters.environment}
workspaceId: ${parameters.workspace}