Set request headers

Set request headers 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 need to set request headers for an API call to the internal billing service. Add Authorization…
I need to set request headers for an API call to the internal billing service. Add Authorization with the bearer token stored in sessionToken, Content-Type as application/json, and a custom header X-Client-Version with value 3.2.1. Ensure the headers object exists and that header names are normalized so the service accepts them before the request is sent.

Improve — make it easier to accept

+
Before I send this request to billing, make it impossible for the reviewer to miss authentication…
Before I send this request to billing, make it impossible for the reviewer to miss authentication or content issues. Surface missing or empty values for sessionToken, Content-Type, or X-Client-Version, coalesce duplicate header names, and highlight if any header value exceeds 1KB. Return a concise summary and a ready-to-attach headers object.

Decide — diagnose the stuck moment

+
I just sent an authenticated request to the billing service and got a 401. I set Authorization from…

The API returned 401 on a request that previously worked

I just sent an authenticated request to the billing service and got a 401. I set Authorization from sessionToken and left Content-Type as application/json. The token was created an hour ago; I do not know whether it expired or was malformed. My deploy went out yesterday so no recent code changes on my side. What is the most likely cause and the next practical checks and fixes I should run now?

Become — change the pattern

+
Across several projects we keep getting flaky authentication or rejection errors caused by headers:…

Repeated errors from services complaining about headers

Across several projects we keep getting flaky authentication or rejection errors caused by headers: tokens occasionally missing, header casing inconsistent, and debug headers accidentally shipped. I spend time hunting each failure on Friday deployments. What habit or small process should I adopt so headers are consistently correct and these incidents stop taking my Fridays?

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.