如何翻譯下面的php curl請求來捲曲可執行命令。如何將Php CURL請求轉換爲命令行卷曲
$curlOpts = array(
CURLOPT_PORT => "3000",
CURLOPT_URL => 'www.example.com',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array("Cookie: connect.sid=aASD234SDFfds", "content-type:application/json"),
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => {"email": "test.com",
"password": "123456"},
);
curl_setopt_array($ch, $curlOpts);
$output = curl_exec($ch);
尊敬的,我想
curl -X GET --header 'Accept: application/json' 'http://www.example.com?sort=clicks&order=des'
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ \
"email": "test.com", \
"password": "123456" \
}' 'http://example.com/login'
請幫我爲同curl命令。
只需閱讀cURL手冊,你就可以自己做到這一點;-) [信息1](http://php.net/manual/en/function.curl-setopt.php) - --- [信息2](http://php.net/manual/en/curl.constants.php) –
只要把你需要的東西和變量,並建立你想要的字符串,這不是一個大處理... – codtex
Php curl函數不返回curl命令url? @AlexOdenthal –