Prototype Ajax.Request modifying header

new Ajax.Request({ajax-url}, {
method:'get',
requestHeaders: {
"Accept": 'application/json'
, "User-Agent": {custom-user-agent}
},
onCreate: function(){},
onComplete: function(){},
onSuccess: function(data){},
onFailure: function(){}
});

 

Point: “User-Agent”: {custom-user-agent}
ex) Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (FM Scene 4.6.1)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.