andru26
3/30/2017 - 11:26 PM

AJAX GET

AJAX GET

$.ajax({  
  type: "GET",
  beforeSend: function (request){
    request.setRequestHeader("Authorization", "Bearer " + auth.authToken);
  },
  dataType: "json",
  contentType: 'application/json; charset=UTF-8',
  url: auth.orderUrl,
})
.done(function( response ) {
  console.log( response );
})
.fail(function( jqxhr, textStatus, error ) {
  var err = textStatus + ", " + error;
  console.log( "Failed: " + err );
})
.always(function() {
  console.log( "complete" );
});