Jump to content

Prestashop Webservice Post Call in ajax


Recommended Posts

i am trying to add customer via prestashop webservice . but it is giving me error as 401 unautorised. Please help me if i have missed out something in below code

 

 

Note: i m just passing xml value as test just to check whether it works or not.

 

$.ajax({
type:"POST",
contenttype:"application/xml",
datatype:"xml",
data:{
PHP_AUTH_USER:"",
ws_key:"XGX2VQ1IRLVF1H7F4Z8LTZR976PZSASDCF7R",
xml:"test"},
success: function(text) {
alert(getXmlAsString(text));
$("#bid1").text(text);
 
},
error: function(xhr) {
  //something went wrong, handle the error and display a message 
  alert("An error occured: " + xhr.status + " " + xhr.statusText);
  }
});
 
Link to comment
Share on other sites

  • 1 year later...
×
×
  • Create New...