HTTP APIs

更新时间: 2026-06-17 16:47:13

HTTP API settings include basic request details, request headers, request bodies, response parameters, and checkpoints (assertions). Use these settings for HTTP-based test scenarios, especially when you need to extract content from responses by using response parameters or validate responses against business expectations by using checkpoints.

Limits

HTTP versions

Performance Testing Service (PTS) supports the HTTP/1.1 and HTTP/2 protocols. When you debug or start a stress test, the PTS engine automatically negotiates the protocol version with your server. If your server supports HTTP/2, PTS uses HTTP/2 by default. Otherwise, PTS falls back to HTTP/1.1. You do not need to specify the HTTP protocol version when you configure a scenario.

HTTP request headers

When you use HTTP/2, some request headers may be invalid as specified in the HTTP/2 RFC standard. If the ProtocolException:*** is illegal for HTTP/2 messages message appears after you debug an API, delete the header that corresponds to *** from the request header configuration.

The following HTTP/2 request headers are invalid (case-insensitive):

  • Connection

  • Keep-Alive

  • Proxy-Connection

  • Transfer-Encoding

  • Host

  • Upgrade

Request timeout period

The request timeout is triggered when either of the following durations exceeds the configured threshold:

  • The duration from sending a request to receiving the first response packet

  • The interval between any two consecutive response packets

    The socketTimeOut parameter specifies the maximum idle interval between two consecutive packets during client-server communication. This is not the total communication time. For example, if you set the timeout to 10 seconds and data is transmitted every 8 seconds for 10 transmissions, the total communication time is 80 seconds, but no timeout occurs. However, if data is transmitted every 12 seconds, a timeout occurs because the interval between consecutive packets exceeds 10 seconds.

Important

If you configure the request timeout period in both the Basic Request Information and Advanced Settings sections of an HTTP API, the HTTP API-level timeout setting takes precedence over the Advanced Settings section.

  • For more information about how to set the request timeout period in the Basic Request Information section, see Basic request information.

Basic request information

The basic request information on the HTTP API configuration page includes the API name, stress testing URL, and request method. For more information, see Basic request information.

Specify custom request information

  • Header settings

    Define custom request headers for stress testing.

  • Body settings

    Define a request body when custom headers alone do not meet your stress testing requirements.

  • Response parameters

    Extract content from responses to validate whether requests are successful from a business perspective.

  • check points (assertions)

    Validate whether responses meet business expectations.

Advanced settings

  • Domain name mapping

    Map a domain name to a specific IP address so that stress testing traffic goes directly to the target service.

  • HTTPS settings

    Enable SSL Status Loop Resetting and select an SSL protocol for stress testing in PTS.

上一篇: Create a PTS-based stress testing scenario 下一篇: Basic request information
阿里云首页 性能测试 相关技术圈