🚀 New! Kestra raises $3 million to grow Learn more

Request Request

yaml
type: "io.kestra.plugin.fs.http.Request"

Make an HTTP request to a server

This task connects to a HTTP server, sends a request, and stores the response as output. By default, the maximum length of the response is limited to 10MB but it can be increased to at most 2GB by using the options.maxContentLength property. Note that the response is added as output to the task, to download large content it is advised to use the Download task instead.

Examples

Post request to a webserver

yaml
id: "request"
type: "io.kestra.plugin.fs.http.Request"
uri: "https://server.com/login"
headers: 
  user-agent: "kestra-io"
method: "POST"
formData:
  user: "user"
  password: "pass"

Post a multipart request to a webserver

yaml
id: "request"
type: "io.kestra.plugin.fs.http.Request"
uri: "https://server.com/upload"
headers: 
  user-agent: "kestra-io"
method: "POST"
contentType: "multipart/form-data"
formData:
  user: "{{ inputs.file }}"

Post a multipart request to a webserver while renaming the file sent

yaml
id: "request"
type: "io.kestra.plugin.fs.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 }}"

Properties

uri

  • Type: string
  • Dynamic: ✔️
  • Required: ✔️

The fully-qualified URI that points to the HTTP destination

allowFailed

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: false

If true, allow failed response code (response code >=400)

body

  • Type: string
  • Dynamic: ✔️
  • Required:

The full body as a string

contentType

  • Type: string
  • Dynamic: ✔️
  • Required:

The request content type

formData

  • Type: object
  • Dynamic: ✔️
  • Required:

The form data to be send

headers

  • Type: object
  • SubType: string
  • Dynamic: ✔️
  • Required:

The headers to pass to the request

method

  • Type: string
  • Dynamic:
  • Required:
  • Default: GET
  • Possible Values:
    • OPTIONS
    • GET
    • HEAD
    • POST
    • PUT
    • DELETE
    • TRACE
    • CONNECT
    • PATCH
    • CUSTOM

The HTTP method to use

options

The HTTP request options

sslOptions

The SSL request options

Outputs

body

  • Type: string

The body of the response

code

  • Type: integer

The status code of the response

formData

  • Type: object

The form data to be send

When sending a file, you can pass a map with a key 'name' for the filename and 'content' for the file content.

headers

  • Type: object
  • SubType: array

The headers of the response

uri

  • Type: string

The url of the current request

Definitions

RequestOptions

basicAuthPassword

  • Type: string
  • Dynamic: ✔️
  • Required:

The HTTP basic authentication password.

basicAuthUser

  • Type: string
  • Dynamic: ✔️
  • Required:

The HTTP basic authentication username.

connectTimeout

  • Type: string
  • Dynamic:
  • Required:
  • Format: duration

The connect timeout.

connectionPoolIdleTimeout

  • Type: string
  • Dynamic:
  • Required:
  • Default: 0.0
  • Format: duration

The idle timeout for connection in the client connection pool.

defaultCharset

  • Type: Charset
  • Dynamic:
  • Required:
  • Default: UTF-8

The default charset.

followRedirects

  • Type: boolean
  • Dynamic:
  • Required:
  • Default: true

Whether redirects should be followed.

logLevel

  • Type: string
  • Dynamic:
  • Required:
  • Possible Values:
    • ALL
    • TRACE
    • DEBUG
    • INFO
    • WARN
    • ERROR
    • OFF
    • NOT_SPECIFIED

The log level.

maxContentLength

  • Type: integer
  • Dynamic:
  • Required:
  • Default: 10485760

The maximum content length of the response

proxyAddress

  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy address.

proxyPassword

  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy password.

proxyPort

  • Type: integer
  • Dynamic:
  • Required:

The proxy port.

proxyType

  • Type: string
  • Dynamic:
  • Required:
  • Default: DIRECT
  • Possible Values:
    • DIRECT
    • HTTP
    • SOCKS

The proxy type.

proxyUsername

  • Type: string
  • Dynamic: ✔️
  • Required:

The proxy username.

readIdleTimeout

  • Type: string
  • Dynamic:
  • Required:
  • Default: 300.000000000
  • Format: duration

The default amount of time to allow the read connection to remain idle.

readTimeout

  • Type: string
  • Dynamic:
  • Required:
  • Default: 10.000000000
  • Format: duration

The default read timeout.

SslOptions

insecureTrustAllCertificates

  • Type: boolean
  • Dynamic:
  • Required:

Whether the client should disable checking of the remote SSL certificate.

Only applies if no trust store is configured. Note: This makes the SSL connection insecure, and should only be used for testing. If you are using a self-signed certificate, set up a trust store instead.