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...
Written by Dominic Barker
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#