Handle HTTP response

Handle HTTP response in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
I received a 502 from the user profile endpoint. Consume the response and map the JSON to the…
I received a 502 from the user profile endpoint. Consume the response and map the JSON to the client model for display: profile.id, profile.name, profile.avatarUrl. If the response contains validation errors, show them inline; if it’s a server error, surface a friendly retryable message and log the raw response for debugging.

Improve — make it easier to accept

+
Before I wire this response handler into the component, make it easy for QA to test: list the…
Before I wire this response handler into the component, make it easy for QA to test: list the possible HTTP status cases and what the UI will show for each, extract the fields the UI cares about at top, and flag any ambiguous error messages that would confuse support engineers when they read the logs.

Decide — diagnose the stuck moment

+
I fetched the profile and the UI rendered avatarUrl as null although the API team says the field is…

After parsing the response, the UI showed null for avatarUrl.

I fetched the profile and the UI rendered avatarUrl as null although the API team says the field is always present. I’m afraid my parser is swallowing nested properties or the server returned a different shape for some users. I can’t tell whether to adjust my mapping or request a schema fix. What is the most likely misread here and the immediate test I should run to decide the fix?

Become — change the pattern

+
Across projects I frequently patch response handlers to accommodate slightly different shapes:…

Mapping inconsistencies between API and UI

Across projects I frequently patch response handlers to accommodate slightly different shapes: sometimes profile.avatar is a string, sometimes an object, sometimes missing. Those fixes pile up and tests become brittle. What habit or contract should I adopt to stop churning on these mappings, and what small guard or tool will enforce consistent shapes without blocking progress?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.