Skip to content

Create HTTP Testing Tasks


HTTP Testing performs periodic availability monitoring for websites, domains, and backend interfaces based on the HTTP protocol. By real-time monitoring of sites, it statistically reports their availability, provides testing logs and real-time alerts, helping you quickly discover network issues and improve network access quality.

HTTP Testing allows you to send HTTP requests to an application's API interface to verify defined requests and judgment conditions, such as request headers, status codes, response times, etc.

Start Creating

Click Create > API Tests, and select HTTP Protocol.

1. Define Request Format

  1. URL: Supports both HTTP and HTTPS URLs, including four request methods: GET, POST, PUT, and HEAD.
  2. Advanced Settings: Configure advanced settings based on actual needs, including request settings, request body content, certificates, proxies, and privacy.
  3. Name: Customize the HTTP Testing task name, which must be unique within the current workspace.

Advanced Settings

  1. Choose whether the current HTTP request should follow redirects during execution.
  2. Define the request headers to be added to the current HTTP request.
  3. Define the cookies to be added to the HTTP request.
  4. Add HTTP authentication, including username/password.
  1. Select the request body type: text/plain, application/json, text/xml, multipart/form-data, None.
  2. Enter the request body content.
  1. Ignore server certificate errors: When checked, the HTTP test will continue to establish the connection even if the SSL certificate verification fails.
  2. Upload client certificates, including private keys and certificates.
  1. Specify the proxy server address that the HTTP request needs to pass through.
  2. Add the HTTP request headers to be included when sending to the proxy server.

Do not save response content: When this option is checked, the response body content will not be saved during runtime, avoiding sensitive data appearing in the test results. However, please note that this may increase the difficulty of troubleshooting issues.

2. Availability Judgment

Default Mode

Add judgment conditions to match data. Multiple conditions can be combined using "All" or "Any" to implement AND or OR logic.

After defining the request format and adding judgment conditions, click the "Test" button on the right side of the URL to verify whether the testing connection configuration is successful.

Note: The test result is independent of the selected node.

Script Mode

The script mode allows you to write Pipeline scripts to achieve the following functions:

  • Set judgment conditions: Customize complex judgment logic based on business needs, supporting single or multiple condition combinations.
  • Process result data: Customize the processing of testing results, including data cleaning, format conversion, etc.

The script mode flexibly meets the needs of extracting specific fields from responses or performing complex condition judgments.

Example:

body = load_json(response["body"])

if body["code"] == 200 {
  result["is_failed"] = false
} else {
  result["is_failed"] = true
  result["error_message"] = body["message"]
}

In the script, first use load_json to parse the response content into a JSON object, then check if the response status code is 200. If code is 200, mark the result as successful; otherwise, set result's is_failed to true and set error_message to the message in the response content.

For more reading, refer to Custom Testing Tasks.

3. Select Testing Nodes

Currently, TrueWatch has covered 14 testing nodes globally. You can select one or more nodes in China or overseas (only available for Commercial Plan and above users) to quickly start site service quality monitoring.

4. Select Testing Frequency

Select the execution frequency of the testing task, supporting the following options:

  • 1 minute (only available for Commercial Plan and above users)
  • 5 minutes (only available for Commercial Plan and above users)
  • 15 minutes (only available for Commercial Plan and above users)
  • 30 minutes
  • 1 hour
  • 6 hours
  • 12 hours
  • 24 hours

In addition to the specific options provided by the system, you can also input Custom Crontab Tasks to configure scheduled task execution based on minute, hour, day, month, and week cycles.