Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $api_root);
- curl_setopt($ch, CURLOPT_POST, true);
- curl_setopt($ch, CURLOPT_POSTFIELDS, "xml"); // tried http_build_query also
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Added this, still no good
- return curl_exec($ch); // returns false
- $curl = "curl -X POST -d 'xml' {$api_root}";
- return `$curl`; // returns expected xml from server
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $curl = "curl -X POST -d 'xml' {$api_root}";
- return `$curl`; // returns expected xml from server
- // Thanks to all the answers
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- // This appears to default false on CLI, true in libcurl
- curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
Add Comment
Please, Sign In to add comment