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

Fix to not specify responseType when there is no response #20

Open
gahyuun opened this issue Nov 8, 2024 · 0 comments
Open

Fix to not specify responseType when there is no response #20

gahyuun opened this issue Nov 8, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@gahyuun
Copy link
Member

gahyuun commented Nov 8, 2024

Environment

fetch-ax 1.0.10 version

Reproduction

// api
await instance.patch(`${API_PATH.user}/password`, body);

// error
SyntaxError: Unexpected end of JSON input

Describe the bug

When there is no response body, the error occurs because it is parsed as response.json(). ( responseType's default value is json)
I think we should implement the feature to parse based on content-type.

Additional context

No response

Logs

No response

@gahyuun gahyuun added the bug Something isn't working label Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants