2016-02-20 39 views
0

想寫一個PHP腳本以下 捲曲的命令行:尋找語法等同於cURL庫

-d「grant_type = client_credentials」

哪個CURLOPT選項將是 最合適的。這是用於我的android 應用程序的Paypal 訪問令牌請求。

回答

0

這是一個POST變量,所以

$data = 'grant_type=client_credentials'; 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $data); 

數組是also acceptable,當然。

+0

嘿。感謝您及時的回覆。 @Sergeyvidusov –