documentcloud/backbone — pull request #1870 by sharat87 (2012-12-05 14:21:30+00:00)
Title: Allow options.data to be set to null for no data.

When `options.data` is set to `null`, no request payload is sent to the server, even if the method is one of create and udpate.

Currently, there is provision to set `options.data` to override the default payload for create and update methods. But there is no way to tell Backbone not to send any payload. Because of the way `!options.data` is evaluated, even an empty string is considered as *data not set in options*.

**Reason**: There are end points out of my control which are to be run with a POST request but without a request body. Ex.: https://developers.google.com/google-apps/tasks/v1/reference/tasks/clear. That page states that no request body should be sent. But the request is a POST request.

I don't see this breaking any existing use cases, but I may be wrong. If there is a better way to do this or if its possible already, please let me know.

Thank you.