jQuery.xhr
will be an asynchronous HTTP request API returning standards-compliant thenables. We have identified two possible approaches:
- Autosend: control by
options
parameter; advanced functionality viabeforeSend
(similar tojQuery.ajax
) - Chainable: control by
options
and/or chainable setters; advanced functionality viasend: false
and a chainablesend
method
This gist compares the approaches by imagining their use for current jQuery.ajax
examples. To better highlight differences, chaining methods will be used instead of options
more heavily than is likely in actual practice (assuming that options
is available in the "Chainable" solution).