I'm trying to use Extjs's feature to convert graphics into images. I'm not requesting svg.sencha.io directly from the javascript, instead, I'm trying to call using cUrl in my php code. For some reasons, calling it from the php is my only option and with the cUrl code that I'm using right now, I always get "Bad request". So, my question is: Have anyone around here dealt with this situation before? Here is the code I'm trying to work with:
$url = 'http://svg.sencha.io';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$file = curl_exec($ch);
curl_close($ch);
var_dump($file);
The $_POST
contains the parameters type, width, height and svg. They seem to be fine, because I runned cUrl directly from my machine and it worked. So the problem really is with cUrl and php.
The var_dump($file);
prints string(12) "Bad request."
I would really appreciate some help, I've been stuck in this for awhile now.