Skip to content

Request Modes

AI agents interact with the run_test_api tool in two modes. Both produce the same structured output. The difference is how the request is specified.

cURL mode

Pass a raw cURL command. The server parses the method, URL, headers, and payload automatically.

Example prompt:

"Please test this API using this cURL: curl -X POST https://api.example.com/v1/users -H 'Authorization: Bearer xxx' -d '{"name":"test"}', ensure status code is 201 and response contains 'id'"

The cURL parser supports the following flags:

Flag Description
-X / --request HTTP method (GET, POST, PUT, DELETE, etc.)
-H / --header Request header in Key: Value format
-d / --data / --data-raw Request payload (JSON or form-encoded)
--url URL (alternative to positional argument)
-k / --insecure Skip SSL verification (logged as warning)
-L / --location Follow redirects (logged as warning)

Note

Boolean flags like -k and -L are recognized but logged as warnings since they may affect test reproducibility.

Structured mode

Provide individual fields instead of a cURL command. This gives you explicit control over each part of the request.

Example prompt:

"Please test this API at https://api.example.com/v1/users with method GET, and the request header is {"Content-Type":"application/json"}, ensure status code is 200 and response body contains 'data' attribute"

In structured mode, the following fields are available:

Field Required Description
api_name Yes A human-readable name for the test
base_url Yes* The base URL (e.g. https://api.example.com)
endpoint Yes* The API endpoint path (e.g. /v1/users)
method No HTTP method, defaults to GET
headers No Dictionary of request headers
payload No Dictionary of request body data

* Required unless a curl_command is provided.

Choosing a mode

  • cURL mode is convenient when you already have a cURL command, just paste it in.
  • Structured mode is better when you need precise control over individual fields, or when building requests programmatically.

Both modes feed into the same assertion and response pipeline, so the output format is identical.