All Products
Search
Document Center

Chat App Message Service:HTTP Request

Last Updated:Mar 17, 2025

This topic describes how to configure the HTTP Request component. This component allows you to send HTTP requests to a specified URL.

Component information

Icon

HTTP请求@1x

Name

HTTP Request

Preparations

Go to the canvas page of an existing flow or a new flow.

  • Go to the canvas page of an existing flow.

    Log on to Chat App Message Service Console. Choose Chat Flow > Flow Management. Click the name of the flow that you want to edit. The canvas page of the flow appears.

    image

  • Create a new flow to go to the canvas page. For more information, see Create a flow.

Procedure

  1. Click the HTTP Request icon on the canvas to view the configurations on the right.

    image

  2. Configure the component based on your needs. For more information, see Parameters.

  3. Click Save in the upper-right corner. In the message that appears, click Save.

    image

Parameters

Parameter

Description

Example

Request Method

The request method. Valid values:

  • POST

  • GET

image

Timeout

The response timeout duration.

URL

Set the URL that receives the request.

Content Type

The content type. Valid values:

  • application/json

  • application/x-www-form-urlencoded

Failure branch

Enable Failure Branch to handle the flow when the request fails.

image

Request Header Configuration

Enter the following information:

  • Key

  • Value

image

Request Body Configuration

When the request method is POST, you can configure the request body.

Key-Value:

  • Key

  • Value

Raw: The raw value must be entered manually.

For more information, see Request body configurations and examples.

image

Request Path Configuration

When the request method is GET, you can configure the request path.

  • Key

  • Value

image

Response Variable Configuration

Ensure that the variable name matches the key of the JSON object of the response.

image

Request body configuration and examples

The request body configuration supports two methods: Key-Value and Raw.

  • Key-Value: This method is recommended when your request body structure is relatively simple. You can refer to the following example:

    Set the key of the first key-value pair to MyName with the value haiwei.dhw; the key of the second key-value pair to customerName with the value as the variable {{customerName}}.

    At this time, the data format for the content type application/json would be: {"myName": "haiwei.dhw", "customerName": "{{customerName}}"}; the data format for the content type application/x-www-form-urlencoded would be: "myName=haiwei.dhw&customerName={{customerName}}".

    image

  • Raw: This method is recommended when your request structure is more complex. You can freely edit the entire request body. The raw value of the request body must correspond to the selected content type, which can be either application/json or application/x-www-form-urlencoded.

    application/json

    For the content type application/json, refer to the following example:

    {
      "customerNames": [
        {
          "name": "{{customerName}}",
          "type": "vip",
          "intentional": true,
          "intentionLevel": 5
        }
      ],
      "myName": "haiwei.dhw",
      "someConplicatedStructure": {
        "a": {
          "b": "c"
        }
      }
    }

    image.png

    application/x-www-form-urlencoded

    For the content type application/x-www-form-urlencoded, refer to the following example:

    customerNames[0][name]={{customerName}}&customerNames[0]
    [type]=vip&customerNames[0]
    [intentional]=true&customerNames[0]
    [intentionLevel]=5&myName=haiwei.dhw&someConplicatedStructure[a][b]=c

    image.png