Skip to content

safeParseResponse breaks on empty response. #213

Closed
@po5i

Description

@po5i

Hey team!

I have some endpoints that do some logic in the server and just reply with 200 and empty content. In those cases the safeParseResponse function breaks when trying to parse an empty body:

image

I think the appropriate response from the API should be 204 No Content. I own the API and I can do such change nevertheless I can see the client is not handling that case either.

Is there a recommended way to handle this outside of the client? Is it feasible to consider handling this case on the client?

I'd like to hear from you.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions