> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-testing/probes/http-probe.md).

# HTTP Probe

Configure HTTP probes to validate service endpoints during chaos experiments

HTTP probe allows you to specify a URL that the experiment uses to determine the health or service availability (or other custom conditions) as part of the entry or exit criteria. The response code or body received is matched against expected values. It supports both HTTP GET and POST methods.

## When to use <a href="#when-to-use" id="when-to-use"></a>

Use this probe in scenarios such as the following:

* Validate that a service endpoint returns the expected status code (e.g., `200 OK`) during or after fault injection
* Confirm API responses contain expected data before, during, or after chaos
* Check health endpoints to verify service availability across fault boundaries
* Validate authentication-protected or TLS-secured endpoints as part of steady-state checks

## Steps to configure <a href="#steps-to-configure" id="steps-to-configure"></a>

Perform the following steps:

1. Navigate to **Project Settings** > **Chaos Probes** and click **+ New Probe**
2. Select **HTTP Probe** and provide a name, and optionally a description and tags
3. Under **Variables**, define any reusable values you want to reference in probe properties or run properties. For each variable, specify the type (`String` or `Number`), name, value (fixed or runtime input), and whether it is required at runtime.
4. Under **Probe Properties**, configure:

   | Field                        | Description                                                                                                                    |
   | ---------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
   | **URL**                      | The endpoint to probe (e.g., `http://localhost:8080`)                                                                          |
   | **Authorization** (optional) | **Type**: `Basic` or `Bearer`. **Credentials**: Base64-encoded `username:password` for Basic, or a bearer token                |
   | **TLS Config** (optional)    | **CA File**, **Cert File**, **Key File**: file paths for TLS certificates. **Insecure Skip Verify**: toggle to skip validation |
   | **Method**                   | `GET` or `POST`. For POST, additionally provide the **Body** and **Content Type**                                              |
   | **Header** (optional)        | Custom HTTP headers as key-value pairs                                                                                         |

   Then select **Compare Response Code** or **Compare Response Body** and provide:

   | Field                                 | Description                                                                                                                                                                        |
   | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | **Criteria**                          | Comparison operator. For response code: `==`, `!=`, `>=`, `<=`, `>`, `<`, `oneOf`, `between`. For response body: `contains`, `equal`, `notEqual`, `matches`, `notMatches`, `oneOf` |
   | **Response Code** / **Response Body** | The expected value to compare against (e.g., `200`)                                                                                                                                |

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Response code and response body comparison are mutually exclusive. Choose one per probe.</p></div>
5. Provide the **Run Properties**:

   | Field                          | Description                                     |
   | ------------------------------ | ----------------------------------------------- |
   | **Timeout**                    | Maximum time for probe execution (e.g., `10s`)  |
   | **Interval**                   | Time between successive executions (e.g., `2s`) |
   | **Attempt**                    | Number of retry attempts (e.g., `1`)            |
   | **Polling Interval**           | Time between retries (e.g., `30s`)              |
   | **Initial Delay**              | Delay before first execution (e.g., `5s`)       |
   | **Verbosity**                  | Log detail level                                |
   | **Stop On Failure** (optional) | Stop the experiment if the probe fails          |
6. Click **Create Probe**

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>Saving the probe displays "Select correct criteria from dropdown"</summary>

The criteria must match the comparison you selected. **Compare Response Code** accepts `==`, `!=`, `>=`, `<=`, `>`, `<`, `oneOf`, and `between`. **Compare Response Body** accepts `contains`, `equal`, `notEqual`, `matches`, `notMatches`, and `oneOf`. Select a criterion from the list for your comparison type, then save the probe again.

</details>

<details>

<summary>An endpoint protected by Basic authentication rejects the probe request</summary>

For the `Basic` authorization type, the **Credentials** value must be the Base64-encoded `username:password` string, not the plain username and password. For the `Bearer` type, enter the bearer token.

</details>

<details>

<summary>The probe cannot validate the certificate of a TLS-secured endpoint</summary>

Under **TLS Config**, provide the **CA File** path for the certificate authority that signed the endpoint certificate, and the **Cert File** and **Key File** paths if the endpoint requires a client certificate. Enable **Insecure Skip Verify** only when you intend to skip certificate validation, for example in a test environment.

</details>

{% @harness-feedback/feedback %}
