JSONAPI icon indicating copy to clipboard operation
JSONAPI copied to clipboard

Handling 204

Open ASContis opened this issue 1 year ago • 1 comments

Is there any way to handle response with 204 which have empty response (mean no data in response just returning with 204 status code)?

ASContis avatar Jan 22 '24 11:01 ASContis

This library focuses on handling the response body (decoding to errors, data, metadata per the JSON:API specification). Since a 204 response has no response body, there's nothing to decode using this library. The specifics of an implementation for this response code would depend on which networking library you were using, but I would suspect that it is generally not too difficult to handle 204 codes explicitly by not trying to do anything with the response body.

I'm happy to help think through this further, though, especially if I am missing part of the question.

mattpolzin avatar Jan 22 '24 16:01 mattpolzin