dswmmvrg40957 2016-04-21 14:30
浏览 61

解析PHP Rest API更新查询不起作用

I want to get data and also update some rows's data. this code retrive all data from table

function updateStatus(){
        $url = 'https://api.parse.com/1/classes/xxxxxxx';
        $appId = 'xxxxxxxxx';
        $restKey = 'xxxxxxxxx';
        $headers = array(
        "X-Parse-Application-Id: " . $appId,
        "X-Parse-REST-API-Key: " . $restKey
        );
        $queryParse = '{"date":"21-04-2016"}';
        $rest = curl_init($url.$queryParse);
        curl_setopt($rest,CURLOPT_URL,$url);
        curl_setopt($rest,CURLOPT_HTTPHEADER,$headers);
        curl_setopt($rest,CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($rest,CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($rest);
        curl_close($rest);
        return $response;
    }

and query Parse also like

$queryParse = urlencode('where={"date":"21-04-2016","time":07:00 to 10:00}');

But both are not working.

  • 写回答

1条回答 默认 最新

  • duanping2809 2016-04-21 15:22
    关注

    Based on the documentation, you should pass the whereconstraint:

    ...
    $queryParse = 'where='.urlencode('{"date":"21-04-2016"}');
    $rest = curl_init($url."?".$queryParse);
    ...
    
    评论

报告相同问题?

悬赏问题

  • ¥50 如何增强飞上天的树莓派的热点信号强度,以使得笔记本可以在地面实现远程桌面连接
  • ¥15 MCNP里如何定义多个源?
  • ¥20 双层网络上信息-疾病传播
  • ¥50 paddlepaddle pinn
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services