{
  "id": 22887913,
  "title": "The POST arrived as a GET, without its auth header. Redirects your HTTP client follows without telling you.",
  "url": "https://urgent.news/2026/12/01/the-post-arrived-as-a-get-without-its-auth-header-redirects-your-http",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-12-01T02:45:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/minpin_proxy/the-post-arrived-as-a-get-without-its-auth-header-redirects-your-http-client-follows-without-4k06"
  },
  "original_language": null,
  "account": "The POST request arrived at a GET endpoint without the Authorization header, causing a 401 error. This issue stems from HTTP redirects, which are automatically followed by libraries like URLSession and OkHttp. When a redirect occurs, the method and body of the request may change, leading to unexpected behavior. For example, a POST request may be converted to a GET request, and the Authorization header may be stripped. This can cause problems such as JSON decoding errors, expired sessions, and authentication issues. To resolve these problems, it is important to understand how redirects are handled by the HTTP client, and to configure the client appropriately. This may involve disabling redirects, using specific redirect methods (such as 307 or 308), or adding custom authentication for trusted hosts. Additionally, it is important to check the final response and ensure that it is in the expected format before attempting to decode it. By following these best practices, developers can avoid common pitfalls related to HTTP redirects and ensure that their applications behave as expected.",
  "summary": "The bug report: the endpoint works in the API docs' \"try it\" page, works in curl, and from the app the server logs show a GET with no body where the app sent a POST . Or the request arrives without its Authorization header and gets a 401 . Or the app crashes decoding JSON because the \"response\" starts with <!DOCTYPE html> . The app's code never mentions a redirect. That's the problem: URLSession…",
  "summary_source": "publisher",
  "key_points": [
    "POST request sent to GET endpoint without Authorization header",
    "HTTP redirects automatically followed by libraries like URLSession, OkHttp",
    "Issue causes 401 error, unexpected behavior like JSON decoding errors"
  ],
  "editors_take": "Developers face authentication failures and data errors when HTTP clients automatically change request methods and strip headers during redirects without proper configuration.",
  "opinion": false,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "machine_translated": false,
  "ai_generated": true,
  "disclaimer": "Accounts, briefs, key points, the editor’s take and translations are written by software from other outlets’ reporting and may contain errors. A summary whose summary_source is \"publisher\" is the outlet’s own feed text. Always check the linked original."
}