Re:How to Design Better APIs
by bcrosby95 on Saturday March 12, 2022 @10:58AM
(#30652221)
We wrap the response body because it's important to give clients of an API endpoint, something that they will use to query/modify data, a clear indicator of the application response status. We do this in the response body because http status codes aren't good enough, and people tend to miss headers. It's hard to miss it when it's part of the body.
And no, we don't do that for static content for a simple reason: static content isn't served from our API servers.
And no, we don't do that for static content for a simple reason: static content isn't served from our API servers.