Skip to content Skip to sidebar Skip to footer

How To Send Put Request With Data As An Xml Element, From Javascript?

My data is an xml element & I want send PUT request with JavaScript. How do I do this ? For reference : Update Cell EDIT : As per fredrik suggested, I did this :
jQuery's ajax method and changing the method to PUT and content type and send a serialized XML.

The jQuery documentation says:

The type of request to make ("POST" or "GET"), default is "GET". Note: Other HTTP request methods, such as PUT and DELETE, can also be used here, but they are not supported by all browsers.

Invoke a ajax call:

 $.ajax({
  url: 'ajax/test.html',
  type: 'PUT',
  contentType: 'text/xml',
  processData: false,
  data: xmlDocument,
  success: function(data) {
    console.log(data);
  }
});

Hope it works.

EDIT: Please provide some more information/code on what you are trying to do.

Post a Comment for "How To Send Put Request With Data As An Xml Element, From Javascript?"