Blog

How to test an API endpoint before you build the screen

The backend developer writes: “The endpoint is ready, here’s the cURL.” Two days into building the screen, it turns out a field has a different name, the time comes without a time zone and the response takes two seconds. Checking the endpoint before the first line of code takes a quarter of an hour. In Microkoi Bench, it starts with that same cURL command.

Why mismatches are found too late

Models, the network layer and the screen are written against the API description. The server differs from the description in small things: a field name, a date format, null instead of an empty list.

A small thing found before the screen is built costs one message to the backend developer. Found after, it costs reworking the models, the parsing and the screen.

A cURL command becomes a request

The command from the backend developer
curl 'https://stage.example.com/v3/plans/week?from=2026-11-02' \
  -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiJ9.stage' \
  -H 'Accept-Language: en'

Open the “Requests” section, create a tab with ⌘T and paste the command into the address bar. The method, address, headers and body are parsed automatically. ⌘↩ sends the request.

The request is sent by the app itself, not by a built-in browser. Browser restrictions on headers and cross-domain requests don’t get in the way, and the response time is measured precisely.

Read the response like a contract

Staging response, 200 OK
{
  "weekStart": "2026-11-02",
  "workouts": [
    {
      "id": "w-1187",
      "title": "Interval run",
      "startsAt": "2026-11-02 07:30",
      "durationMin": 40
    }
  ]
}

A 200 doesn’t mean much yet. This response raises two questions. The start time came as a string without a time zone: it’s unclear whose time it is, the user’s or the server’s. The duration is called durationMin, while the API description says duration.

Both questions go to the backend developer now, before a single line is written against this response.

Where the response time goes

The response header shows the total time and a bar of phases: what that time was made of. For example:

PhaseTimeWhat was happening
“DNS lookup”12 msResolving the server name to an address
“Connection”38 msOpening the TCP connection
“Handshake”61 msSetting up the TLS connection
“Waiting for response”1,790 msUntil the first byte of the response
“Download”9 msReceiving the response body

The network isn’t to blame: the server spends almost all the time thinking. Change from to last week and send it again. If the response arrives in 140 ms, the current week’s plan is computed on every request. The backend developer gets a question with numbers, not “something is slow”.

Staging and production are two environments

A staging address and a token typed into every request have to be edited by hand each time you switch. Move them into environments: the “Environments” button is on the right of the tab bar, and you pick the active one in the list next to it.

Variable“Staging”“Production”
baseUrlhttps://stage.example.com/v3https://api.example.com/v3
tokentest user tokentest user token

The request address becomes {{baseUrl}}/plans/week, and the “Auth” tab has “Bearer token” selected with the value {{token}}. Switch the environment, and the same requests go to another server. If a variable isn’t found, the request still goes out, and a warning appears above the response: a typo in a name won’t go unnoticed.

The lock button hides a variable’s value behind dots but doesn’t encrypt it. Environments are regular workspace files and go to git along with it. Production passwords and keys don’t belong in shared environments.

The rest of the API in one import

The screen will need other endpoints too. Click “Import” above the collection tree and paste the address of the API description, the openapi.json file. Bench detects the format and shows a summary before importing: how many folders and requests there will be, for example “3 folders · 14 requests”, and which environment gets the server address baseUrl.

The same summary lists what won’t carry over: requests with unsupported methods, external schema references. Bench reads OpenAPI 3 and Swagger 2 in JSON and YAML, a Postman collection and a cURL command — as a file, by address or as pasted text.

Edge cases with copies of the same request

The happy path is checked. Edge cases take five minutes with copies of the request, and for each one you write down in advance what should come back:

What to changeWhat to expect
“No auth” on the “Auth” tab401
from=11/02/2026 instead of 2026-11-02400 with a clear error
A week with no planAn empty list, not null
Header X-Request-Id: {{$uuid}}A new id in every request

If a wrong date returns 500, that’s one more question for the backend developer. In production, send only read requests as a test user: edge cases aren’t tested on live data.

What you keep after the check

Requests are saved to a collection as files in the workspace’s collections folder. Put the workspace in git next to the app code, and the next developer on the screen opens the same requests with the same environments.

The “Copy as cURL” button gives you the command exactly as it would go over the network, with variables filled in. Remove the token before posting it in a chat.

Questions to the backend developer get settled the same day, before the screen exists. Models are written once — for the response you’ve seen, not the one described in words.

Check your next endpoint this way in the beta and write to beta@microkoi.com about what you found and what the API client was missing. We read every email.

Try it on your own project

The beta is free and needs no sign-up. Download it, pick your project folder and start the proxy — your first requests will show up within minutes.

Version 0.9.6 · macOS, Windows and Linux · no sign-up