Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

ajax add custom header

$.ajax({
  type: "POST",
  url: "/SupportHelpText.ashx", // c# web service to get HTML data
  beforeSend: function (xhr) { xhr.setRequestHeader('RequestVerificationToken', $('input[name="__RequestVerificationToken"]').val()) },
  data: { 'CustomerName': 'Test Customer' },
  success: function (data) {
    console.log(data);
  },
  error: function (data) {
    console.log(data);
  }
})
 
PREVIOUS NEXT
Tagged: #ajax #add #custom #header
ADD COMMENT
Topic
Name
3+1 =