php - XML parsing error : no element found -


I'm quite new, so I'm seeing something clearly,

I'm making a curl Post like this:

  $ import = '& lt; Client & gt; & Lt; Full name & gt; Space ada & lt; / Fullname & gt; & Lt; / Client & gt; '; $ Ch = curl_init (); Curl_setopt ($ CH, CURLOPT_URL, "https://www.examplesecure.com/clients.xml"); Curl_setopt ($ CH, CURLOPT_USERPWD, "12343223434fkgnfd: x"); Curl_setopt ($ CH, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); Curl_setopt ($ CH, CURLOPT_SSL_VERIFYPEER, incorrect); // curl_setopt ($ ch, CURLOPT_SSL_VERIFYHOST, incorrect); Curl_setopt ($ ch, CURLOPT_SSLVERSION, 3); // fix http_code 400 curl_setopt ($ ch, CURLOPT_CUSTOMREQUEST, "POST"); // curl_setopt ($ ch, CURLOPT_POST, true); // curl_setopt ($ CH, CURLOPT_VERBOSE, 1); Curl_setopt ($ CH, CURLOPT_RETURNTRANSFER, 1); Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('Accept: app / xml', 'Content-Length:'. Strlen ($ import)); Curl_setopt ($ CH, CURLOPT_POSTFIELDS, $ import); $ Data = curl_xac ($ ch); $ Info = curl_getinfo ($ ch); Curl_close ($ ch); If ($ info ['http_code'] == 400) {echo "RESPONSE:" $ data; Echo "
INFOS:"; Echo "& lt; east & gt;"; Var_export ($ info); } And {header ("content-type: text / xml"); Echo $ data;}

and browser (firefox) answer: XML parse error: no element found Location: Line number 2, column 1:

I did Have tried various forms of POSTFIELDS but the solution can not be found, any suggestions are welcome _


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -