-3
我需要更換與file_get_content捲曲(我已刪除敏感信息):更換捲曲與file_get_content
curl -F 'client_id=aaa' \
-F 'client_secret=bbb' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=http://testtest.altervista.org/instagram/' \
-F 'code=ccc' \
https://api.instagram.com/oauth/access_token
我tryed這一點,但好好嘗試一下工作(它返回任何結果):
$url = 'https://api.instagram.com/oauth/access_token?client_id=aaa&client_secret=bbb&grant_type=authorization_code&redirect_uri=http://testtest.altervista.org/instagram/&code=ccc';
print json_decode(file_get_contents($url));
爲什麼?
當您在瀏覽器中運行該URL時,您會得到什麼? – Exception
您正在用php file_get_contents替換'shell'cURL命令......您在這裏的真正目標是什麼? – YvesLeBorg
當你在URL中有一個URL時,內部URL必須是'urlencode()'。如果您什麼都沒有收到,那麼顯示錯誤日誌或至少顯示調用返回的標題和狀態代碼會很有幫助。 – DanFromGermany