This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
$httpBackend coersion of falsy values to null before xhr.send() #11552
Closed
Description
Can anyone explain why this line in $httpBackend should coerce falsy values to null?
xhr.send(post || null);
https://github.com/angular/angular.js/blob/master/src/ng/httpBackend.js#L112
This means that, if I need to POST, PUT, etc. an actual boolean false to a web service, I have to work around AngularJS.
I'd like the line to read something like this:
xhr.send(post);
or if it just can't be undefined or something:
xhr.send(isDefined(post) ? post : null);