Dotcom-Monitor allows you to define which HTTP response status codes are considered successful for both monitoring and load testing HTTP requests. This lets you tailor success criteria beyond the default interpretation, helping you get accurate results based on your real-world expectations.

By default, responses in the 200-399 status code range are treated as successful. But sometimes, you need to set up monitoring of specific HTTP(S) codes—like 401 Unauthorized when monitoring a login-required page or expecting to receive specific error codes for certain APIs.

In load tests, for example, you may expect some non-200 responses under high load. Defining which codes are acceptable helps avoid false failures that aren’t relevant to your goals.

 When you configure accepted HTTP codes, responses with those codes will count as successes; anything outside your defined set will be logged as errors.

How to Configure Expected HTTP Codes

  1. Open your HTTP(S) target settings.
  2. Go to the Basic tab and find the Expected response codes field.
  3. In the Expected response codes field, enter the codes you want to treat as acceptable. You can list multiple individual codes (e.g. 401, 500) or define ranges (e.g. 500-599).
  4. Save your configuration. From then on, any response code outside of those ranges will trigger an error in the test results.

Examples

  • If you want to check that access to a restricted page leads to a 401 Unauthorized, you set 401 as an expected code. If Dotcom-Monitor receives a 401, it marks it successful; if it receives 200 OK (i.e., public access), that’s flagged as an error.
  • If you’re load testing an API that returns 500 codes under certain stress conditions, you could allow codes in the 500-599 range so those are not treated as failures.