I need to set a custom http header before 'Edit' (PUT) only. I tried the loadBeforeSend as mentioned here - How to set request header to the ajax object for jqGrid
loadBeforeSend: function(jqXHR) {
alert('loadBeforeSend');
jqXHR.setRequestHeader('If-Match', '*');
},
But this function gets invoked before every request. I need this header to be set only on a 'PUT' request but not on any other. My 'GET' request actually fails with this header.
How do I check if it is a PUT or a GET inside the loadBeforeSend ? or is there another way to do this?
Thanks in advance!