I am posting xml data to server which is working fine in my local, but after uploaded to server, its breaking the data at client side I hope.
Request payload in my local server
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>xxxxxxxxxxx</ApiKey>
<Data xsi:type="Subscriber">
<Mode>AddAndUpdate</Mode>
<Force>true</Force>
<ListId>16</ListId>
<Email>abc@gmail.com</Email>
<Firstname>abc</Firstname>
<Lastname>cdf</Lastname>
</Data>
</ApiRequest>
Request payload after uploading to server
<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<ApiKey>xxxxxxxxxxx
<Data xsi:type="Subscriber">
<Mode>AddAndUpdate
<Force>true
<ListId>16
<Email>abc@gmail.com
<Firstname>abc
<Lastname>cdf
This is integration of ExpertSender. files are hosted in Acquia Cloud.
What could be the possibility of this issue? How can I solve this?
This is my Post call code,
var postData = '<ApiRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"><ApiKey>xxxxxxx</ApiKey><Data xsi:type="Subscriber"><Mode>AddAndUpdate</Mode><Force>true</Force><ListId>16</ListId><Email>'+emailVal+'</Email><Firstname>'+firstnameVal+'</Firstname><Lastname>'+lastnameVal+'</Lastname><Properties><Property><Id>1</Id><Value xsi:type="xs:integer">'+telVal+'</Value></Property></Properties></Data></ApiRequest>';
var postUrl = 'https://api2.esv2.com/Api/Subscribers';
jQuery.ajax({
type: "POST",
url: postUrl,
data: postData,
contentType: "text/plain; charset=utf-8",
cache: false,
success: function(response) {
success.html(sucessMsg);
},
error: function(response) {
var xmlData = jQuery.parseXML( response.responseText );
var message = jQuery( xmlData ).find("Message").text();
if (message.search("Email is invalid")){
failed.html(errorMsg);
}else{
failed.html(message);
}
}
});
It was the text editor configuration.
In Drupal-8, the "mail text" text editor's "Correct faulty and chopped off HTML" option actually doing crazy with XML content.