Skip to main content
Version: 2.3.3

Send HTTP Requests on Workflow

Chaos Mesh Workflow provides a Task node to support any workload, similar to Kubernetes Job. To make the user experience more convenient, Chaos Dashboard provides a template based on Task to create HTTP requests in WebUI.

Chaos Mesh Workflow provides a Task node to support any workload, which function is similar to the Job in Kubernetes. To provide a better user experience, Chaos Dashboard provides a template based on Task. With this template, you can easily create HTTP requests in WebUI. This document describes how to create an HTTP request through Chaos Dashboard.

note

Chaos Mesh does NOT have the workflow node of the type HTTPRequest. This feature is based on Task node, and you can send HTTP requests more conveniently by using the feature.

note

This feature is currently an experimental feature, so it is not recommended to use this feature in the production environment. The configuration and behavior of the feature might change in the future.

Create an HTTP request through Chaos Dashboard

You can create an HTTP request in Chaos Dashboard as the following steps that take sending a message through Slack Webhook as an example.

Step 1. Create a workflow node with the type HTTPRequest

Select "HTTP Request" as the task type:

create-http-request-workflow-node

Step 2. Configure an HTTP request

Configure the followings:

  • node name: send-slack-message
  • request URL: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
  • request method: POST
  • request body: {"text": "Hello, world."} , then check "For JSON content".

configure-http-request-workflow-node

Step 3. Submit the workflow node

Click the "Submit" button to see the task in the preview window:

http-request-task-node-preview

Field description

ParameterTypeDescriptionDefault valueRequiredExample
NamestringName of the workflow nodeYessend-slack-message
URLstringURL of an HTTP requestYeshttps://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX
MethodstringMethod of an HTTP requestYesPOST
BodystringBody of an HTTP requestNo{"text": "Hello, world."}
Follow 301/302 LocationbooleanThe value of this parameter corresponds to the -L parameter of curl.falseNofalse
Json ContentbooleanThe parameter appends Content-Type: application/json to the header of an HTTP request.falseNofalse

The value of the name field of the generated task node adds the suffix http-request to the end of "name".