1、getメソッド
$結果=のfile_get_contents($ personUrl)。
2、JSONを使用してのQueryStringを使用してPOSTメソッド
$ personUrl = "http://www.wacloud.net/open/persion/insert?appid=$doorAppid&sign=$sign×tamp=$timestamp"。
$情報=配列
('canAttence' => trueの場合
、'canPass' => trueの場合、
'カード' => $ cardNum、
'deptIdList' => [6330]、
'effectEndTime' => "2019年7月28日午前2時10 :39.305Z」、
'effectStartTime' => "2019年7月20日02:10:39.305Z"、
'モバイル' => "18866668888"、
'名前' => "临时访客"、
'たopenType' => 2、
'persionType' => 2、
'ステータス' => 0
)。
$コンテキスト= stream_context_create(配列(
'HTTP' =>アレイ( '方法' => 'POST'、
'ヘッダ' => ' コンテンツタイプ:アプリケーション/ JSON'、
'コンテンツ' => json_encode($情報)、
'タイムアウト」=> 20)
));
$コンテキスト= stream_context_create(配列(
'HTTP' =>配列( 'メソッド' => 'POST'、
'ヘッダ' => 'Conten T-タイプ:アプリケーション/ x-www-form-urlencodedで '、
'コンテンツ' => http_build_query($情報)、
'タイムアウト' => 20)
));
$結果=のfile_get_contents($ personUrl、偽、$コンテキスト);
しますprint_r($結果);