yaml
type: "io.kestra.plugin.core.http.request"
Examples
yaml
id: api_call
namespace: company.team
tasks:
- id: basic_auth_api
type: io.kestra.plugin.core.http.Request
uri: http://host.docker.internal:8080/api/v1/executions/dev/inputs_demo
options:
basicAuthUser: admin
basicAuthPassword: admin
method: POST
contentType: multipart/form-data
formData:
user: John Doe
yaml
id: jwt_auth_call
namespace: company.team
tasks:
- id: auth_token_api
type: io.kestra.plugin.core.http.Request
uri: https://dummyjson.com/user/me
method: GET
headers:
Authorization: 'Bearer <TOKEN>'
yaml
id: api_key_auth_call
namespace: company.team
tasks:
- id: api_key_auth
type: io.kestra.plugin.core.http.Request
uri: https://dummyjson.com/user/me
method: GET
headers:
X-API-KEY: abcde12345
yaml
id: api_key_auth_call
namespace: company.team
tasks:
- id: api_key_in_query_params
type: io.kestra.plugin.core.http.Request
uri: "https://dummyjson.com/user/me?api_key={{ secret('API_KEY') }}"
method: GET
yaml
id: timeout
namespace: company.team
tasks:
- id: http
type: io.kestra.plugin.core.http.Request
uri: https://reqres.in/api/long-request
timeout: PT10M # no default
method: GET
options:
connectTimeout: PT1M # no default
readTimeout: PT30S # 10 seconds by default
connectionPoolIdleTimeout: PT10S # 0 seconds by default
readIdleTimeout: PT10M # 300 seconds by default
yaml
id: http_post_request_example
namespace: company.team
inputs:
- id: payload
type: JSON
defaults: |
{"title": "Kestra Pen"}
tasks:
- id: send_data
type: io.kestra.plugin.core.http.Request
uri: https://dummyjson.com/products/add
method: POST
contentType: application/json
body: "{{ inputs.payload }}"
- id: print_status
type: io.kestra.plugin.core.log.Log
message: '{{ outputs.send_data.body }}'
yaml
id: http_post_request_example
namespace: company.team
tasks:
- id: send_data
type: io.kestra.plugin.core.http.Request
uri: "https://server.com/login"
headers:
user-agent: "kestra-io"
method: "POST"
formData:
user: "user"
password: "pass"
yaml
id: http_post_multipart_example
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: send_data
type: io.kestra.plugin.core.http.Request
uri: "https://server.com/upload"
headers:
user-agent: "kestra-io"
method: "POST"
contentType: "multipart/form-data"
formData:
user: "{{ inputs.file }}"
yaml
id: http_post_multipart_example
namespace: company.team
inputs:
- id: file
type: FILE
tasks:
- id: send_data
type: io.kestra.plugin.core.http.Request
uri: "https://server.com/upload"
headers:
user-agent: "kestra-io"
method: "POST"
contentType: "multipart/form-data"
formData:
user:
name: "my-file.txt"
content: "{{ inputs.file }}"
yaml
id: http_upload_image
namespace: company.team
tasks:
- id: s3_download
type: io.kestra.plugin.aws.s3.Download
accessKeyId: "{{ secret('AWS_ACCESS_KEY_ID')}}"
secretKeyId: "{{ secret('AWS_SECRET_KEY_ID')}}"
region: "eu-central-1"
bucket: "my-bucket"
key: "path/to/file/my_image.jpeg"
- id: send_data
type: io.kestra.plugin.core.http.Request
uri: "https://server.com/upload"
headers:
user-agent: "kestra-io"
method: "POST"
contentType: "image/jpeg"
formData:
user:
file: "my-image.jpeg"
url: "{{ outputs.s3_download.uri }}"
metadata:
description: "my favorite image"
yaml
id: http_csv_file_upload
namespace: company.team
tasks:
- id: http_download
type: io.kestra.plugin.core.http.Download
uri: https://huggingface.co/datasets/kestra/datasets/raw/main/csv/orders.csv
- id: upload
type: io.kestra.plugin.core.http.Request
uri: "https://server.com/upload"
headers:
user-agent: "kestra-io"
method: "POST"
contentType: "multipart/form-data"
formData:
url: "{{ outputs.http_download.uri }}"
yaml
id: http_multiline_json
namespace: company.team
inputs:
- id: title
type: STRING
defaults: This is the title of the request
- id: message
type: STRING
defaults: |-
This is my long
multiline message.
- id: priority
type: INT
defaults: 5
tasks:
- id: send
type: io.kestra.plugin.core.http.Request
uri: "https://reqres.in/api/test-request"
method: "POST"
body: |
{{ {
"title": inputs.title,
"message": inputs.message,
"priority": inputs.priority
} }}
Properties
uri *Requiredstring
body string
contentType string
Default
application/json
encryptBody booleanstring
Default
false
formData object
headers object
SubType string
method string
Default
GET
options Non-dynamicHttpConfiguration
Default
{
"followRedirects": "true",
"allowFailed": "false",
"defaultCharset": "UTF-8"
}
Outputs
body object
code integer
encryptedBody string
formData object
headers object
SubType array
uri string
Format
uri
Definitions
io.kestra.core.http.client.configurations.TimeoutConfiguration
connectTimeout string
Format
duration
readIdleTimeout string
Default
PT5M
Format
duration
io.kestra.core.http.client.configurations.BasicAuthConfiguration
type *Requiredobject
password string
username string
java.nio.charset.Charset
io.kestra.core.http.client.configurations.HttpConfiguration
allowFailed booleanstring
Default
false
allowedResponseCodes array
SubType integer
defaultCharset Charsetstring
Default
UTF-8
followRedirects booleanstring
Default
true
logs array
SubType string
Possible Values
REQUEST_HEADERS
REQUEST_BODY
RESPONSE_HEADERS
RESPONSE_BODY
proxy ProxyConfiguration
ssl SslOptions
timeout TimeoutConfiguration
io.kestra.core.http.client.configurations.ProxyConfiguration
address string
password string
port integerstring
type string
Default
DIRECT
Possible Values
DIRECT
HTTP
SOCKS