lnjl.net
ǰλãҳ >> ΪʲôҪʹCurljson >>

ΪʲôҪʹCurljson

//ʹcurl⣬postʽjson //jsonݵϿԲοjsoncpp⣬Ҳ԰jsonʽԼַ //ע´벻Զִ߳Уִ߳УҪпƣб [cpp] view plain copy #includ...

file_get_contents $json = file_get_contents('php://input');$data = json_decode($json, True);

POSTΪ{"data":"abc"} POSTΪdata ͬPHPΪܲش£

curl -d -i URL

1.wget wget --post-data="user=user1&pass=pass1&submit=Login" http://domain.com/path/page_need_login.php 2.curl (ֱӷ͸ʽjson) ύjsonҪheader'json={"phone":"13521389587","password":"test"} curl...

㽫$helloֱӽjsons Ҫա $hello=json_en......;һм $data=array('hello'=>$hello); curl_setopt($ch,CURLOPT_POSTFIELDS,$hello);ijcurl_setopt($ch,CURLOPT_POSTFIELDS,$data); URL...

$postData = file_get_contents('php://input');ҵIJ͡PHP cURLʵģ¼ɼʹ÷⡷ʮһȡjsonݡѾϸĽܣλȡͷjsonݡοhttp://www.zjmainstay.cn/php-curl

$res = curl_exec($ch);//ִֻһcurl㻹Ҫȡ $content = curl_getinfo($ch);//ȡ echo json_encode($content);//ȡ curl_close($ch);//رһcurl

԰, header application/json

򿪿һ£ ׺json ĴJavaScript룡

վҳ | վͼ
All rights reserved Powered by www.lnjl.net
copyright ©right 2010-2021
磬ַϵͷzhit325@qq.com