I would like to HTTP.POST
to another server with XML data but its return data: null
my code is as below:
HTTP.call(‘POST’,‘www.example.com/Search.php’,{
headers: { ‘Content-Type’ :‘multipart/form-data’,
‘Accept’:‘application/xml’,
‘Access-Control-Allow-Origin’:’*’,
‘Access-Control-Allow-Methods’:‘GET,PUT,POST,DELETE’,
‘Access-Control-Allow-Headers’:‘Content-Type’},
data:
'requestXML:<?xml version="1.0" encoding="utf-8"?>
<Service_SearchHotel>
<AgentLogin>
<AgentId>xxx</AgentId>
<LoginName>xxxx</LoginName>
<Password>xxx</Password>
</AgentLogin>
<SearchHotel_Request>
<PaxPassport>MA05110184</PaxPassport>
<DestCountry>WSASTH</DestCountry>
<DestCity>WSASTHBKK</DestCity>
<HotelId InternalCode=""></HotelId>
<Period checkIn="2017-11-26" checkOut="2017-11-28" />
<RoomInfo>
<AdultNum RoomType="Twin">2</AdultNum>
<ChildAges />
</RoomInfo>
<flagAvail>Y</flagAvail>
</SearchHotel_Request>
</Service_SearchHotel>'
}, function(error,response){
if (error) {
console.log(error);
}else{
console.log(response)
}
same data return all XML in google postman
but in my console
data:null
headers:
content-type:“text/html; charset=UTF-8”
ps:
'requestXML: mandatory from server on beginning of all post
any kind of help could save my day