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, 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: Test: Result: You should make sure that the page you are echoing is also using the MIM type Another way I can think of to avoid HTML characters by using $ data_string I am stripped of XML and only values remain.
$ 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);
$ data_string echo;
John Doe22seattle
text / xml .
Comments
Post a Comment