Skip to content
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
@johnhoffman

Description

@johnhoffman

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);

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions