You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi i'm getting SyntaxError: JSON Parse error: Unexpected EOF, after receiving an empty response from server with a status 200.
The only way to changing this behavior is changing responses from server to no content(204) ?
Loggin my response with afterResponse hook i got this
According to the HTTP/1.1 specifications (RFC 7231), 200 OK responses have a payload body, while 204 No Content don't. With this in mind, I believe ky is behaving correctly.
However, I can also understand that many APIs and developers do not respect this distinction (or maybe they're lazy :P) so, spec complaint or not, maybe we need this feature anyway.
Got: https://github.com/sindresorhus/got/blob/295979693bb179b32d11107367c57c31cb05bf78/source/core/response.ts#L140-L142
Discussed in #374
Originally posted by cruzms August 27, 2021
Hi i'm getting
SyntaxError: JSON Parse error: Unexpected EOF
, after receiving an empty response from server with a status 200.The only way to changing this behavior is changing responses from server to no content(204) ?
Loggin my response with afterResponse hook i got this
The text was updated successfully, but these errors were encountered: