For web testing, an HTTP status code is a starting signal, not a complete verdict. The first digit groups a response into a broad class—informational, successful, redirection, client error, or server error—but the specific code, request method, headers, response body, and endpoint contract determine what the client should actually do. A 202 Accepted, for example, does not mean asynchronous work has finished, and a 304 Not Modified is about cache validation, not an ordinary redirect.
How to interpret an HTTP status code
An HTTP response carries a status code along with headers and, depending on the response and application, possibly a body. The code describes an aspect of the response’s outcome. It does not, by itself, explain the root cause of a failure or specify every detail of an API’s error format.
The first digit gives the broad class:
- 1xx — Informational: interim, protocol-level information. A client library may expose the final response rather than each interim response, so most application tests need not assert a direct 1xx response.
- 2xx — Successful: the request was successfully received, understood, and accepted. The particular code says more about what success means.
- 3xx — Redirection: further action, such as following a redirect or reusing a cached representation, may be involved.
- 4xx — Client error: the request cannot or will not be fulfilled because of a condition attributed to the request, credentials, permissions, or resource state.
- 5xx — Server error: the server or an intermediary failed to fulfill an apparently valid request.
These are classes, not interchangeable outcomes. RFC 9110 notes that a client is not required to understand every registered status code, although doing so is desirable. Tests should therefore handle expected codes precisely and have a sensible fallback for codes the client does not recognize. See RFC 9110, HTTP Semantics and the IANA HTTP Status Code Registry.
What common status codes mean for web testing
This is a selective guide to commonly encountered codes, not a complete status-code registry. Treat the endpoint’s documented contract and the request method as part of every assertion.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstall#1 Best Overall
- Read Before You Buy — No Video Output: These adapters support charging and USB 2.0 data transfer, but cannot transmit video signals. Except for standard USB webcams (which use USB data only), they are not compatible with HDMI/DisplayPort cables, video-capable USB-C hubs, or docking stations with video output.
- Convert USB-A Ports to USB-C: Designed to connect USB-C earphones, cables, flash drives, card readers, and other USB-C accessories to standard USB-A ports. Plug-and-play with no drivers or software required.
- Aluminum Alloy Housing: Built with a sturdy aluminum alloy shell that aids in heat dissipation and protects against daily wear and scratches. Designed to maintain a stable and secure connection.
- Compact & Travel-Friendly: The ultra-compact design allows the adapter to stay plugged into your device without blocking adjacent ports or adding bulk, reducing wear and tear on your original USB ports.
- 12-Month Warranty: Backed by a 12-month manufacturer warranty for peace of mind. Designed to meet strict quality control standards for reliable everyday performance.
| Code | Meaning | What to verify |
|---|---|---|
| 200 OK | The request succeeded. | Check the representation and relevant headers expected for this method and endpoint. A 200 alone does not prove the returned content is correct. |
| 201 Created | The request succeeded and resulted in one or more resources being created. | Where the contract specifies them, verify the created resource and its identifier or location, as well as any response representation. |
| 202 Accepted | The request was accepted for processing, which may not yet be complete. | Do not treat the operation as finished just because the response is 202. If the API defines a job-status resource, polling mechanism, or callback, test that follow-up flow. |
| 204 No Content | The request succeeded and there is no response content. | Verify the absence of response content when required by the contract; do not attempt to parse a representation that should not be there. |
| 301 / 302 | Permanent or temporary redirection semantics, respectively. | Check the intended destination and whether the client follows the redirect. If method preservation or conversion matters, test the actual client behavior rather than assuming all clients handle it identically. |
| 304 Not Modified | A conditional request indicates that a stored representation remains current. | Send the relevant conditional request and verify cache behavior. This is not an ordinary redirect; the client can reuse its stored representation instead of receiving a fresh one. |
| 400 Bad Request | The server cannot or will not process a request it considers a client error, such as malformed syntax or framing. | Test the relevant invalid-request case and assert a stable, documented error response if the application defines one. There is no universal error-body schema implied by 400. |
| 401 Unauthorized | The request lacks valid authentication credentials for the target resource, and the response is an authentication challenge. | Verify the applicable WWW-Authenticate challenge. RFC 9110 requires at least one applicable challenge in a 401 response. Test authentication behavior separately from permission checks. |
| 403 Forbidden | The server understood the request but refuses to fulfill it. | Exercise the refusal condition independently of missing or invalid credentials. Unlike 401, 403 is not an authentication challenge. |
| 404 Not Found | No current representation is found, or the server is unwilling to disclose that one exists. | Test a missing route or resource. Account for applications that deliberately return 404 to conceal a resource’s existence. |
| 409 Conflict | The request conflicts with the current state of the target resource. | Create a state-conflict case and verify the documented way for a client to resolve the conflict or resubmit. |
| 429 Too Many Requests | Commonly used to signal that a client has sent too many requests in a given amount of time. | If rate limiting is in scope, inspect the response and the retry guidance in the API contract or response. The code alone does not establish a universal retry delay. |
| 500 Internal Server Error | The server encountered an unexpected condition that prevented it from fulfilling the request. | Treat it as a server-side failure; do not infer the internal cause from the code alone. |
| 502 Bad Gateway | A gateway or proxy received an invalid response from an upstream server. | Investigate the intermediary-to-upstream path and the validity of the upstream response. |
| 503 Service Unavailable | The server is temporarily unable to handle the request. | Check any retry guidance and recovery behavior supplied by the response or application. |
| 504 Gateway Timeout | A gateway or proxy did not receive a timely response from an upstream server. | Distinguish an upstream timeout at an intermediary from an application returning a generic 500. |
For registered codes beyond these examples, consult the IANA registry and the defining specification. A client may encounter a registered code it does not know; its handling should not silently turn an unexpected response into a successful test.
Why 2xx does not always mean “finished”
The common shortcut “2xx means success” is too broad for a test assertion. Success can mean that a representation was returned, a resource was created, work was accepted for later processing, or an operation completed without response content.
Rank #2
- 5-in-1 USB-C Hub: Experience comprehensive connectivity featuring a Power Delivery input, two USB-A 2.0 ports, a USB-A 3.0 port, and an HDMI port. (Note: The USB-C power delivery input port is only for connecting an external wall charger to power your laptop and cannot power peripheral devices.)
- 90W Pass-Through Charging: Achieve optimal charging with 90W pass-through power to your laptop, supported by a total input of 100W, with the hub reserving 10W for operational efficiency. (Note: Wall charger not included.)
- Quick Data Transfers: Accelerate your productivity with rapid data transfers using a high-speed 5Gbps USB 3.0 port and two 480Mbps USB 2.0 ports.
- 4K HDMI Display: Enhance your visual experience with a hub capable of delivering 4K resolution at 30Hz in both mirror and extend modes. Please note that this hub is compatible with MacBook (macOS 12 and newer), Windows 10 and 11, ChromeOS, and laptops equipped with DP Alt Mode and Power Delivery. Note: This device is not compatible with Linux.
- What You Get: Anker USB-C Hub (5-in-1, 4K HDMI), welcome guide, 18-month warranty, and our friendly customer service.
- For 200, validate the response representation and headers required by the endpoint.
- For 201, validate creation, including a resource identifier or location when the contract specifies one.
- For 202, validate acceptance and then the documented asynchronous completion path. Do not assert the final business result immediately unless the API promises synchronous completion despite the code.
- For 204, validate success without trying to parse a response representation.
The HTTP semantics define the code; the endpoint contract defines such application details as the body schema, resource fields, and how to check the progress of accepted work.
How to distinguish 401, 403, and 404
These codes can all occur when a user cannot access something, but they describe different cases. A 401 is an authentication challenge and must include an applicable WWW-Authenticate challenge. A 403 means the request was understood but refused. A 404 means no current representation is available—or the server has chosen not to disclose that one exists.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →Rank #3
- Sleek 7-in-1 USB-C Hub: Features an HDMI port, two USB-A 3.0 ports, and a USB-C data port, each providing 5Gbps transfer speeds. It also includes a USB-C PD input port for charging up to 100W and dual SD and TF card slots, all in a compact design.
- Flawless 4K@60Hz Video with HDMI: Delivers exceptional clarity and smoothness with its 4K@60Hz HDMI port, making it ideal for high-definition presentations and entertainment. (Note: Only the HDMI port supports video projection; the USB-C port is for data transfer only.)
- Double Up on Efficiency: The two USB-A 3.0 ports and a USB-C port support a fast 5Gbps data rate, significantly boosting your transfer speeds and improving productivity.
- Fast and Reliable 85W Charging: Offers high-capacity, speedy charging for laptops up to 85W, so you spend less time tethered to an outlet and more time being productive.
- What You Get: Anker USB-C Hub (7-in-1), welcome guide, 18-month warranty, and our friendly customer service.
Build separate tests for missing or invalid credentials, authenticated-but-refused requests, and absent resources. Do not assert that every unauthorized user must receive 403 or that every inaccessible resource must reveal itself with a 404; check the application’s documented policy. In particular, concealment can make a 404 intentional rather than evidence that routing is broken.
How 502, 503, and 504 differ
These responses indicate different conditions along a server and intermediary path:
Rank #4
- Dual Converters, Infinite Potential:Includes 2× USB C male to USB A female adapters and 2× USB A male to USB C female adapters. Perfect for a wide range of uses—tablets with Bluetooth keyboards, expand USB ports on macbook, and more. Two different converters for all your daily needs
- Next-Level 10Gbps & 3A Charging: No more slow 480Mbps, this usb to usb c adapter has a transfer speed of up to 10Gbps, allowing you to do more transferring in less time. This usb adapter fits both USB A and USB C charger, supporting up to 3A fast charging
- Upgraded Exquisite Craftsmanship: With an aluminum alloy housing and metal connector, the usbc to usb adapter is extremely durable and sturdy. Rigorously tested to withstand more than 10,000 times of plugging and unplugging, ensuring long-lasting performance
- Broad Compatible: The usb c to usb adapter widely supports all USB C/ USB A devices like laptops, tablets, cellphones, car chargers, and phone chargers. Such as compatible with MacBook Pro/Air 2023/2022, Thunderbolt 4/3 Devices,Apple MagSafe Watch 9/8/7/SE/Ultra, iPad Pro 2022/2021, Samsung Galaxy S23/S20/S10, and iPhone 17/16/15 Pro. Plug and play
- Please Note: To reach 10Gbps speed, keep the cable under 3.3 ft. For USB A Male to USB C adapters, try flipping the USB C connector. USB C Male to USB A adapters support bidirectional 10Gbps transfer within 3.3 ft
- 502 Bad Gateway: a gateway or proxy received an invalid response from upstream.
- 503 Service Unavailable: the server is temporarily unable to handle the request.
- 504 Gateway Timeout: a gateway or proxy did not receive an upstream response in time.
When a test receives one of these codes, record which endpoint and path were involved, then use the status semantics to guide diagnosis. A 502 or 504 points attention toward an intermediary/upstream interaction; a 503 signals temporary unavailability. None of the codes alone identifies the underlying operational cause. Test retry behavior only where the response or service contract defines it.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Turn status semantics into a useful test
A good HTTP test checks the response contract rather than merely matching a number. Work through the request and expected outcome in this order:
Best Value
- 5-in-1 Connectivity: Equipped with a 4K HDMI port, a 5 Gbps USB-C data port, two 5 Gbps USB-A ports, and a USB C 100W PD-IN port. Note: The USB C 100W PD-IN port supports only charging and does not support data transfer devices such as headphones or speakers.
- Powerful Pass-Through Charging: Supports up to 85W pass-through charging so you can power up your laptop while you use the hub. Note: Pass-through charging requires a charger (not included). Note: To achieve full power for iPad, we recommend using a 45W wall charger.
- Transfer Files in Seconds: Move files to and from your laptop at speeds of up to 5 Gbps via the USB-C and USB-A data ports. Note: The USB C 5Gbps Data port does not support video output.
- HD Display: Connect to the HDMI port to stream or mirror content to an external monitor in resolutions of up to 4K@30Hz. Note: The USB-C ports do not support video output.
- What You Get: Anker 332 USB-C Hub (5-in-1), welcome guide, our worry-free 18-month warranty, and friendly customer service.
- Define the request: record the HTTP method, URL, request headers, relevant body, and the application state before the request.
- State the expected transition: decide whether the endpoint should return a representation, create a resource, accept deferred work, redirect, reuse a cached representation, reject a request, or report a server-side problem.
- Choose the specific status: compare the expected behavior with the code semantics in RFC 9110 and the endpoint contract. Do not assert a class such as “any 2xx” if different codes imply materially different outcomes.
- Check headers that carry behavior: for example, validate the applicable
WWW-Authenticatechallenge on 401, the destination on a redirect, or cache metadata in a conditional-request flow, when relevant to the contract. - Check the body only when appropriate: validate a response schema if a representation is expected; verify no response content for a 204; and avoid imposing an undocumented universal error payload on 400, 404, or other errors.
- Exercise the next step: follow redirects when that is what the real client does, reuse a cached representation after a valid 304, check documented completion behavior after 202, and test retry guidance only when it is actually specified.
- Keep protocol and application rules separate: HTTP defines status semantics, while the application defines choices such as its error schema, polling path, and conflict-resolution process.
This approach makes a failure easier to interpret. A wrong status, missing required header, unexpected body, or broken follow-up is a more actionable finding than a test that says only “expected 200.”
Use screenshots as a separate visual check
A screenshot can help verify what a browser rendered after a request, but it does not replace inspecting the HTTP status, headers, or API response. Use network or API assertions for protocol behavior, and use screenshots as a complementary check for visible outcomes such as a redirect destination, an error page, or a completed interface state.
Or skip the browser setup:
For a rendered-page check, ScreenshotNeo can return an image from one GET request. Its capture flow accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before the shot; each of those steps can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers indicate the page verdict and billing status. It also provides an MCP server with take_screenshot, get_page_info, and capture_pdf tools for AI agents.
Install a command-line HTTP client such as cURL and provide a ScreenshotNeo API key. See the ScreenshotNeo API documentation for request options and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo is a visual companion to status-code testing, not a substitute for checking protocol responses. It includes 1,000 screenshots a month free with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Quick Recap
Common status-code testing mistakes and fixes
- Asserting only “2xx”: this can let a test pass for 202 when it expected a finished operation, or for 204 when it expected a representation. Assert the endpoint’s specific code and behavior.
- Parsing a body for 204: the response has no content. Assert the expected absence of response content instead of decoding JSON.
- Treating 304 as a redirect: it is conditional cache validation. Send the appropriate conditional request and check whether the client reuses its stored representation.
- Using 401 and 403 as synonyms: check authentication challenge behavior separately from a refusal of an understood request.
- Expecting every 404 to prove a route is broken: the server may intentionally use 404 to conceal whether a resource exists. Check the intended resource and disclosure policy.
- Inferring the root cause from a 5xx code: 500 does not reveal the internal fault, and gateway codes identify a point in the request path rather than the complete cause. Use the code to focus investigation, then correlate it with the service’s own diagnostics.
- Assuming a universal 429 retry delay: inspect the response and API contract for actual retry guidance; do not derive a fixed wait from the code alone.
- Letting a client hide redirect behavior: if redirect status, destination, or method handling matters, test the redirect response and the behavior of the client used in production.
Standards and reference
- RFC 9110: HTTP Semantics, published by the RFC Editor in June 2022.
- IANA: Hypertext Transfer Protocol (HTTP) Status Code Registry.
- MDN Web Docs: HTTP response status codes.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

