If the server sends a 204 status code, Reqwest raises an exception:
reqwest("/204") // https://gist.github.com/jalada/fda3dc2d14d05efe97ba
Uncaught TypeError: Cannot read property 'match' of null reqwest.js:239
(anonymous function) reqwest.js:85
This seems unlikely. I can write a test for it, but could you provide details about the server response
Same for responses from HEAD requests. Seems like this library doesn't handle the condition of empty responses.
Would this work for a fix? #164
That's right. Responses containing no Content-Type header throw an error inside of setType.
Just got this exact situation. 204 with no Content-Type => exception.
I got the same error. It happens when response contains no "Content-Type" AND request options has no "type" option.
I've just added "type" into request options. And it works.
#160 Fix problem where no specificed content-type throws exceptions.
ok it looks like the PR for the fix it obviously out of date. we should try and get this fix in
ded, can you please publish the fixed code on npm as 2.0.2? Thank you very much for your work, we depend on it a lot :)
yikes i forgot to publish
Thank you! One step further would be to put this fix into 1.x (the non-xhr2 version stream) as well.
Update reqwest to 2.0.5
This includes a fix for a bug where 204 responses were treated as
errors. We need that for the email subscription form in the footer.