Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axios Unable to Handle "204 No Content" Responses #6327

Open
yuchen001 opened this issue Mar 27, 2024 · 0 comments
Open

Axios Unable to Handle "204 No Content" Responses #6327

yuchen001 opened this issue Mar 27, 2024 · 0 comments

Comments

@yuchen001
Copy link

Describe the bug

As of today, Axios seems to be unable to handle requests that result in a "204 No Content" response. Any API request that responds with a 204 status code is treated as a timeout.

Preliminary testing and investigation suggest that the issue might be related to Axios instances.

It might be challenging to provide a publicly accessible test case since finding APIs that reliably respond with a 204 status code could be difficult.

To Reproduce

As of the latest observation, Axios encounters an issue where responses with an empty body (e.g., "204 No Content") are incorrectly treated as timeouts when using an Axios instance.

Notably, when requests are made without creating an Axios instance directly, the behavior is as expected.

Steps to Reproduce:

  • Create an Axios instance.
  • Make a request using the Axios instance to an API endpoint that returns a response with an empty body (e.g., 204 status code).
  • Observe that the Axios instance incorrectly handles the response as a timeout.

Code snippet

No response

Expected behavior

Axios should accurately handle responses with an empty body, such as 204 status codes, without treating them as timeouts.

Axios Version

No response

Adapter Version

No response

Browser

No response

Browser Version

No response

Node.js Version

No response

OS

No response

Additional Library Versions

No response

Additional context/Screenshots

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant