Quick answer

An API may return a 200 with an empty body, or the body might be missing.

API Empty Response Body

An API may return a 200 with an empty body, or the body might be missing. If you expect JSON, an empty body is invalid JSON and will cause parse errors.

Common causes

How to fix

FAQ

Is an empty body valid JSON?
No. Valid JSON is at least a value (e.g. null, [], {}). An empty string is not valid JSON.
What if the API returns 204?
204 No Content means no body by design. Do not try to parse JSON; check status first.

Fix it now

Try in validator (prefill this example)

Related

All tools · Canonical