Thread:Project:Support desk/api action=query

I don't know why the following code fails to print out the query... $url = "action=query&prop=info&intoken=edit&titles=Document_1";

$ch = curl_init; curl_setopt_array($ch, $app["curloptions"]); curl_setopt($ch, CURLOPT_URL, $app["apiURL"]); curl_setopt($ch, CURLOPT_POSTFIELDS, $url); $result1 = unserialize(curl_exec($ch)); if(curl_errno($ch)){ Death("Error 003: " . curl_error($ch),"API connection failed."); } curl_close($ch); print_r($result1);//die;//DEBUG

however, this seems to work: $postdata = "action=login&format=php&lgname=". $app["username"]. "&lgpassword=". $app["password"];

$ch = curl_init; curl_setopt_array($ch, $app["curloptions"]); curl_setopt($ch, CURLOPT_URL, $app["apiURL"]); curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata); $result = unserialize(curl_exec($ch)); if(curl_errno($ch)){ $curl_error = "Error 003: ". curl_error($ch); } curl_close($ch); print_r($result);