Php 任何人都可以在这些框刷新令牌脚本上提供帮助吗?

Php 任何人都可以在这些框刷新令牌脚本上提供帮助吗?,php,curl,oauth-2.0,token,Php,Curl,Oauth 2.0,Token,你能告诉我,在执行了这个之后,我也没有得到适当的回应 我的脚本 $cmd="curl https://api.box.com/oauth2/token \ -d 'grant_type=refresh_token&refresh_token=uuuuuuuuu&client_id=uuuuuuu&client_secret=uuuuuuu' \ -X POST"; exec($cmd,$result); 响应 Array ( [0] => {"error":"in

你能告诉我,在执行了这个之后,我也没有得到适当的回应

我的脚本

$cmd="curl https://api.box.com/oauth2/token \ -d 'grant_type=refresh_token&refresh_token=uuuuuuuuu&client_id=uuuuuuu&client_secret=uuuuuuu' \ -X POST"; exec($cmd,$result);
响应

Array ( [0] => {"error":"invalid_request","error_description":"Invalid grant_type parameter or parameter missing"} )
根据这一点,box.net文档缺少OAuth请求的
内容类型
需要是
application/x-www-form-urlencoded
的信息

因此,尝试在cURL请求的末尾添加一个
-H“Content-Type:application/x-www-form-urlencoded”

cURL文档说明已设置
内容类型:application/x-www-form-urlencoded
。但根据我在Stack Overflow(、和)上找到的其他答案,尝试手动设置内容类型可能对box.net OAuth API特别有帮助