Last Updated: February 25, 2016
·
1.012K
· dakuan

AJAX request headers

It's possible to mess about with the headers of you AJAX requests. With jQuery you can do this:

var deferred = $.ajax({
                    ....
                  beforeSend: (xhr) ->
                    xhr.setRequestHeader('Content-Type', 'application/json')
});

I had to do this to get the Google url shortening service to work...

more documentation