freebase cURL and mqlwrite with PHP

oksh

New Member
Hi am doing some testing on the Freebase sandbox, but I can't get the following request to work. It hangs for ages then returns nothing. I have also outputted curl_getinfo() if it helps anyone work out where I am going wrong.\[code\]echo $uri = "http://".$this->config['apiSandboxHost'].'/'.$this->config['apiWritePath'].'={"create":"unless_exists","type":"/user/docs/music/note","name":"A","id":null}';$ch = curl_init($uri);curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);$headers = array();$headers[] = 'X-Metaweb-Request : idio';$headers[] = 'Content-length: 78';$headers[] = 'Content-type: application/x-www-form-urlencoded';$headers[] = 'Cookie: '. implode(';', $this->authCookies);curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);$output = curl_exec($ch);pr(curl_getinfo($ch));curl_close($ch);echo $output;\[/code\]Output\[code\]http://sandbox.freebase.com/api/service/mqlwrite?query={"create":"unless_exists","type":"/user/docs/music/note","name":"A","id":null}Array( => http://sandbox.freebase.com/api...=> 0)\[/code\]Thanks in advance for any help!
 
Back
Top