{
  "id": 12723917,
  "title": "Axios timeout for chunked responses",
  "url": "https://urgent.news/2026/10/07/axios-timeout-for-chunked-responses",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-07T22:02:33.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/n0th1ng_else/axios-timeout-for-chunked-responses-39j4"
  },
  "original_language": "en",
  "account": "Axios is a popular JavaScript library used for making HTTP requests. One interesting aspect of Axios is its timeout feature, which allows developers to set a limit on how long a request can take before it is cancelled. In a recent project involving a Telegram bot that converts voice messages into text, the author encountered an unexpected behavior when using Axios with chunked responses.\n\nThe author created a simple HTTP server using Express, with a single API endpoint that takes 10 seconds to resolve. They then used Axios to make a POST request to this endpoint, specifying a timeout of 5 seconds. Upon running the code, they observed that the request took exactly 5 seconds to complete, as expected.\n\nHowever, when the author integrated Axios with a streaming API for their Telegram bot, they encountered a problem. The bot receives voice messages in chunks, which are processed and sent back to the user in real-time. By using Axios, the author found that the timeout was reset with each chunk received, effectively cancelling the overall request time.\n\nTo demonstrate this issue, the author created a new Express endpoint that sends one chunk of the response every second, for a total of 10 seconds. When they made a POST request to this endpoint using Axios with a timeout of 10 seconds, they saw that the request was resolved as soon as the first chunk was received, despite the remaining chunks taking a significant amount of time to be sent.\n\nThis unexpected behavior of Axios with chunked responses can lead to inaccurate timing and potentially affect the performance of applications that rely on real-time data, such as the Telegram bot in this case.",
  "summary": "ALRIGHT, this was an interesting one. I use Axios in one of my pet projects . Basically, the project is a Telegram bot that transforms voice messages into text. I know that Telegram now has this feature for premium subscribers, but this is not something we are about to cover in this article. Here I want to talk about the tricky way the Axios timeout works. Let's start with the simple HTTP server…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}