IPRout

HTTP Headers and Content Types

Every IPRout request needs one supported API key header. Clients may also send Accept: application/json, and browser integrations can send an Origin header that is evaluated against paid-plan CORS restrictions. Successful API data and error messages are JSON, so status-aware clients should validate the response before decoding it.

Last updated September 12, 2026

Which authentication header should I use?

Authorization: Bearer YOUR_API_KEY is recommended because most HTTP libraries support it directly. X-API-Key is available for gateways and clients that prefer a dedicated key header. Send one clear authentication method, redact it from logs, and never place the secret in a URL query parameter.

When does the Origin header matter?

Browsers attach Origin to cross-origin requests. Starter and Pro keys can be created with exact origin allowlists, so scheme, host, and port must match. Server-to-server clients do not use browser CORS enforcement in the same way and should protect the key through server-side secret storage.

How should JSON responses be detected?

Check the HTTP status and response Content-Type before assuming the body matches a success model. Preserve the error body for controlled diagnostics, but do not log credentials or excessive user IP data. Clients should fail explicitly when a proxy returns an unrelated HTML error page.

How should HTTP header behavior be implemented?

Send one authentication form consistently, request JSON explicitly where useful, and let browsers supply Origin. Never place a key in query parameters or combine conflicting authentication headers. Keep this responsibility close to the IPRout client so the behavior documented in HTTP Headers and Content Types remains consistent across web requests, workers, and scheduled jobs.

How should HTTP header behavior be verified?

Test Bearer and X-API-Key independently, missing authentication, an allowed browser Origin, and an HTML intermediary error. Parsing should reject unexpected content types cleanly. Automate the stable cases and reserve live checks for controlled environments so verification is repeatable without consuming unnecessary production allowance.

How should HTTP header behavior be operated?

Configure application, proxy, and tracing layers to redact Authorization and X-API-Key. Preserve safe status and content-type information because it is valuable during diagnosis. Write down the owner and expected behavior so an alert or product change can be handled without reconstructing the original integration decisions.

Where does HTTP header behavior stop?

Origin is relevant to browser CORS evaluation, while server-to-server clients need ordinary secret protection. Accept does not guarantee that every intermediary failure will return JSON. Treat that limit as part of the feature contract and direct callers to the related guide when they need a different guarantee or control.

What belongs in the release review for HTTP header behavior?

Review the deployed implementation of HTTP Headers and Content Types, not only a local sample. Confirm the intended endpoint, credential source, timeout, response model, and fallback from the environment that will carry real traffic. Use the verification cases above as release evidence, inspect generated browser assets and logs for secret exposure, and make sure dashboards identify the workload without storing raw credentials or unnecessary IP data. Record the configuration owner and rollback action before enabling the feature broadly.

When should HTTP header behavior be revisited?

Revisit HTTP header behavior when traffic volume, plan capacity, application ownership, deployment regions, browser origins, data retention, or the product consequence of a lookup changes. Compare the current implementation with the documented operating boundary rather than assuming the original decision still fits. Update tests and internal runbooks together, then verify the public API contract and related IPRout guides before rolling the change across every service that shares the client or account.

External references

Continue with the standards and official documentation most relevant to this guide.

Continue building with IPRout

Test the API, browse runnable examples, or return to the documentation directory.