03 / API & Auth / api-testing

API Testing Workbench

Send real HTTP requests from your browser with auth, body, assertions and cURL import.

ReadyLocal processing
03 · Workspace

How to use

  1. 01Choose a method (GET, POST, PUT, PATCH, DELETE, HEAD or OPTIONS), enter the request URL and press Send; press Cancel to abort a slow request.
  2. 02Add query parameters on the Params tab and headers on the Headers tab, using the checkboxes to toggle rows and quick-add buttons for Content-Type, Accept, Cache-Control and X-Request-ID.
  3. 03On the Auth tab pick No Auth, Basic, Bearer, API Key (sent as a header or query parameter) or Custom Header; on the Body tab pick JSON, Form URL Encoded, Multipart or Raw.
  4. 04Or press Import cURL, paste a command copied from DevTools or API docs, and press Import into workbench to fill in the method, URL, params, headers, auth and body.
  5. 05Add checks on the Assertions tab, such as status, JSONPath values or response time, and see them pass or fail as soon as the response arrives.
  6. 06Inspect the response status, latency, size and content type, switch between Pretty, Raw and Headers views, and copy or download the body or the generated cURL command.

What is this tool?

A browser-based API client for sending real HTTP requests and checking the responses with assertions. Requests go straight from your browser to the API with fetch(), with no proxy server in between, and credentials are held in memory only: never stored, logged or sent anywhere except the URL you call. It is built for quick checks during QA and development, combining cURL import, authentication helpers, live assertions and cURL export in one page.

Why your API request fails with a CORS error in the browser

Because requests are sent directly from the page, the browser enforces the same-origin policy. An API only answers browser requests from another origin if it returns Access-Control-Allow-Origin headers, and non-simple requests, for example ones with a JSON Content-Type, an Authorization header or a PUT or DELETE method, first trigger an OPTIONS preflight that must also succeed. When it does not, the browser hides the reason from JavaScript, so the workbench shows Request failed and explains that CORS, an unreachable host or an invalid certificate are the likely causes.

The workbench does not route traffic through a proxy to work around this, which is what keeps your tokens between you and your API. If a request is blocked, use Copy as cURL and run it in a terminal, where CORS does not apply. Public APIs designed for browsers, your own APIs with CORS enabled for testing, and localhost services that allow your origin work directly.

CORS also limits what you see: the Headers view only lists response headers the server exposes via Access-Control-Expose-Headers, and requests are sent without browser cookies, so endpoints that rely on a session cookie will respond as if you are logged out. Use a Bearer token or API key instead.

Importing cURL commands from Chrome DevTools and API docs

In Chrome or Edge DevTools, right-click a request in the Network panel and choose Copy as cURL (bash), then paste it into Import cURL. The importer understands -X, -H, -d, --data-raw, --data-binary, --data-urlencode, --json, -F, -u, -G, -I, -A, -b and -e, ignores output-only flags such as -s, -L, -k and --compressed, and handles quotes and backslash line continuations. A command with a body but no -X becomes a POST, matching curl's own behavior.

The import also tidies the request: query strings are split into Params rows, an Authorization: Bearer header moves to the Bearer auth field, Basic credentials are decoded into the username and password fields, and the body type is detected from the Content-Type header or the content itself, so JSON is pretty-printed and form data becomes editable rows.

Testing authenticated APIs and asserting on responses

Basic auth builds Authorization: Basic with UTF-8-safe Base64, Bearer strips an accidental leading Bearer from a pasted token, and API Key can go in a header such as X-API-Key or be appended to the query string. All secret fields are masked inputs held only in component state, so a page reload clears them, and the workbench keeps no request history.

Assertions run against every response automatically. A typical smoke test for POST /users might assert Status is one of 200, 201, JSONPath exists $.id, JSONPath equals $.name Ava and Response time below (ms) 2000. Each row shows PASS or FAIL with the actual value, and the tab shows how many passed. The JSON body editor validates as you type and blocks sending invalid JSON, and the Timeout (ms) field, 30,000 by default, turns a hung request into a clear Request timed out error.

Common use cases

  • Smoke-testing a staging endpoint after a deployment
  • Replaying a request copied as cURL from Chrome DevTools with modified headers or body
  • Checking that an API rejects a missing or expired Bearer token with 401
  • Verifying the CORS configuration of an API meant to be called from a web front end
  • Turning a manual request into a cURL command to attach to a bug report

FAQ

Is this a Postman alternative?

For quick, one-off requests it covers the essentials: methods, params, headers, auth, bodies, assertions and cURL import and export, with nothing to install. It does not save collections, environments or history, so it complements rather than replaces Postman for larger suites.

Why do I get Request failed when the API works in Postman or curl?

Almost always CORS. Browsers block cross-origin responses unless the server allows them, while Postman and curl are not browsers. Use Copy as cURL to run the same request in a terminal.

Does QADevBench use a proxy or see my API keys?

No. Requests are sent directly from your browser to the URL you enter, and credentials are kept in memory only, never stored or logged.

Can I import a cURL command?

Yes. Press Import cURL, paste the command and press Import into workbench. The method, URL, query parameters, headers, auth and body are filled in automatically.

Why can't I send a body with a GET request?

Browsers do not allow a body on GET or HEAD requests through fetch(), so any body you set is ignored for those methods. Use POST, PUT or PATCH to send a body.

Why are some response headers missing?

Browsers only expose CORS-safelisted response headers plus those listed in the server's Access-Control-Expose-Headers. Other headers are hidden from JavaScript even though the server sent them.