Skip to content Skip to sidebar Skip to footer

Php Curl With Xml Not Working

I'm trying to have use cURL to send an API call to idibu (a job board company in the UK). I've successfully made the call with their test information that they provide. You can see

Solution 1:

You should be using rawurlencode instead of htmlentities, and only on the XML part of the 'payload'. Also, you're defining your constant to the literal text "$xml" by using single quotes around your variable. So replacing those two lines with these should do:

$xml = 'xml_text='.rawurlencode('<?xml … </idibu>'); # <-- insert entire XML there

define('XML_PAYLOAD', $xml);

Post a Comment for "Php Curl With Xml Not Working"