When I execute below code it work fine.\[code\] $url = "https://api.mongolab.com/api/1/databases/$DB/collections/$COLLECTION?apiKey=$MONGOLAB_API_KEY"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data), ) ); echo $response = curl_exec($ch); $error = curl_error($ch); echo $response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($response_code == 200) { $response1=json_decode($response); echo("<pre>");print_r($response1);echo("</pre>"); } else { echo "Fail"; var_dump($data); var_dump($status); }\[/code\]above work well,it insert one record to mongolab database and return Object id but when execute below code it return null response without any error.I have check all that thing are right but why response is null.\[code\]$url = "https://api.mongolab.com/api/1/databases/winebook-dev/collections/persons?fo=true&q={'email':'$email'}&apiKey=".MONGOLAB_API_KEY;$ch = curl_init();curl_setopt($ch, CURLOPT_URL, $url);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HEADER, false);$data = http://stackoverflow.com/questions/15804472/curl_exec($ch);$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);curl_close($ch);if ($status == 200){ $data1 = json_decode($data); $len = count($data1); if($len > 0 ) { echo"This email already resistered."; } else { $url = "https://api.mongolab.com/api/1/databases/$DB/collections/$COLLECTION?apiKey=$MONGOLAB_API_KEY"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data) ) ); $response = curl_exec($ch); $error = curl_error($ch); $response_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($response_code == 200) { $response1=json_decode($response); echo("<pre>");print_r($response1);echo("</pre>"); } else { echo "Fail"; var_dump($data); var_dump($status); } }}\[/code\]if any one know solution then answer this question suddenly.thanks in adv.