nicolasbize/magicsuggest — pull request #77 by rdamborsky (2013-07-22 19:35:56+00:00)
Title: Added beforeSend option to customize ajax requests

I added `beforeSend` option to allow ajax request modifications. The main motivation for this was the ability to add HTTP headers expected by backend.

The parameters correspond with beforeSend method from jQuery:

$('#foo').magicSuggest({
...
beforeSend: function(xhr) {
xhr.setRequestHeader('Authorization', 'API token');
},
...
});