Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

ajax add header

$.ajax({
  type: "POST",
  beforeSend: function(request) {
    request.setRequestHeader("Authority", authorizationToken);
  },
  url: "entities",
  data: "json=" + escape(JSON.stringify(createRequestObject)),
  processData: false,
  success: function(msg) {
    $("#results").append("The result =" + StringifyPretty(msg));
  }
});
Comment

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);
  }
})
Comment

PREVIOUS NEXT
Code Example
Javascript :: como checar valor do input checkbox angular 
Javascript :: ng-true-value 
Javascript :: join on JSON field 
Javascript :: js export options 
Javascript :: importing sha256 hashing algorithm 
Javascript :: jquery numeric validation 
Javascript :: react-router in saga 
Javascript :: greater than or equal to javascript 
Javascript :: add marker on map geocoder result mapbox 
Javascript :: find element in an array and replace it by a callback function 
Javascript :: rows().remove 
Javascript :: add another column without delete table sequelize 
Javascript :: object loop javascript 
Javascript :: how to use axios 
Javascript :: angularjs ng-options name value 
Javascript :: spread and rest javascript 
Javascript :: if without else javascript 
Javascript :: Clone Array Using Spread Operator 
Javascript :: Iterate with JavaScript Do...While Loops 
Javascript :: check property exists in object javascript 
Javascript :: password generator 
Javascript :: sequelize datetime format 
Javascript :: inline style to change background color js 
Javascript :: array from javascript 
Javascript :: javaScript get() Method 
Javascript :: electronjs 
Javascript :: useselector in redux 
Javascript :: online password generator 
Javascript :: Serve the angular application 
Javascript :: minified react error #200 
ADD CONTENT
Topic
Content
Source link
Name
5+4 =