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
Did you know?
JavaScript on a page runs with the privileges of that origin. One altered library, tag manager, or snippet can read inputs, change what people see, and call your APIs as the user.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#