Chrome Extension

$.ajax jQuery

$.ajax({
    url: 'YourRestEndPoint',
    method: 'POST',
    headers: {
        'Authorization':'Token xxxxxxxxxxxxx',
        'Content-Type':'application/json'
    },
    data: { "key": "value" },
    dataType: 'application/json',
    processData: false, //IF YOU ARE SENDING FORM DATA
    contentType: false,
    success: function(data){
      console.log('success: ', data);
    },
    error: function(data) {
        console.log('error: ', data);
    }
});
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool

Above is the code snippet to send ajax request using jQuery. 

Was this helpful?
0 Comments
Join Devsheet Ask a Question