PHP Curl Request with XML -


I can not understand for my life how to put XML formatting in string, even echoing the string While doing, $ data_string I am stripped of XML and only values ​​remain.

Then I should be able to make a curl request through PHP with that string, I'm not. I'm sure that if I have the right setup for that

code:

  $ data_string = '& lt; Test & gt; & Lt; Name & gt; John Doe & lt; / Name & gt; & Lt; Age & gt; 22 & lt; / Age & gt; & Lt; City & gt; Seattle & lt; / Age & gt; & Lt; / Test & gt; '; $ Curl = curl_init ($ baseUrl); Curl_setopt ($ curl, CURLOPT_RETURNTRANSFER, true); Curl_setopt ($ curl, CURLOPT_POST, true); Curl_setopt ($ curl, CURLOPT_POSTFIELDS, "xmlRequest =". $ Data_string); Curl_setopt ($ curl, CURLOPT_HTTPHEADER, array ("content-length:" strlen ($ data_string), "X-DocuSign-authentication: $ header". "Content type: text / xml", "accept: text / xml")) ; $ Response = curl_xax ($ curl);   

Test: $ data_string echo;

Result:

  John Doe22seattle    

You should make sure that the page you are echoing is also using the MIM type text / xml .

Another way I can think of to avoid HTML characters by using

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -