cURL and Freebase's Api

johnnybriggs

New Member
I am having problems with the freebase MQL login service. I am making a post request then the freebase api should send back headers which I will then analyse and get information from.But the only header I am getting is \[code\]HTTP/1.0 200 OK\[/code\]Code\[code\]class myFreebaseClass {....function doLogin() {echo $uri = "http://".$this->config['apiSandboxHost'].'/'.$this->config['apiLoginPath'].'username='.$this->config['apiLoginUser'].'&password='.$this->config['apiLoginPass'];$ch = curl_init($uri);curl_setopt($ch, CURLOPT_HEADER, 1);curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);curl_setopt($ch, CURLOPT_HEADERFUNCTION, array(&$this,'readHeader'));$output = curl_exec($ch);curl_close($ch);}function readHeader($ch, $string){ echo "Header: ".$string."<Br />"; if(strpos($string, 'Set-Cookie') !== false) { $this->authCookies[] = str_replace('Set-Cookie: ', '', $string); } return true;}}\[/code\]Outputs\[code\]http://sandbox.freebase.com/api/account/login?username=dXXXXX&password=XXXXHeader: HTTP/1.0 200 OK \[/code\]What am I doing wrong? Am I getting the headers incorrectly?Thanks in advance!
 
Back
Top