我需要一些帮助连接到deviantArt的API for whois。
我正在构建一个需要连接到deviantArt的API的Laravel应用程序。
我可以使用Socialite,The League's OAuth2-Client,Guzzle和cUrl成功连接到API,但仅限于whoami请求。
GET /user/whoami
我可以成功whois
连接,但只能使用cUrl
POST /user/whois
curl https://www.deviantart.com/api/v1/oauth2/user/whois \
-d "usernames[0]=justgalym" \
-d access_token=Alph4num3r1ct0k3nv4lu3
我希望尽可能多地使用OAuth2-Client插件,但此时,我只是在寻找有用的东西。
我最好的猜测是我没有正确发送POST
个变量。
$options = [
'form_params' => [
'usernames[0]' => 'justgalym',
'expand' => 'user.profile',
],
"Authorization" => "Bearer ".$this->token->getToken()
];
$request = new Request('POST', $url, $options);
$options = [
'form_params' => [
'usernames[]' => 'justgalym',
'expand' => 'user.profile',
],
"Authorization" => "Bearer ".$this->token->getToken()
];
$request = new Request('POST', $url, $options);
$options = [
'form_params' => [
'usernames' => 'justgalym',
'expand' => 'user.profile',
],
"Authorization" => "Bearer ".$this->token->getToken()
];
$request = new Request('POST', $url, $options);
$options = [
'form_params' => [
'usernames' =>
[0 => 'justgalym'],
'expand' => 'user.profile',
],
"Authorization" => "Bearer ".$this->token->getToken()
];
$request = new Request('POST', $url, $options);
$request = $this->provider->
getAuthenticatedRequest(
AbstractProvider::METHOD_POST,
$url, $this->token, ['body' => 'usernames[0]=justgalym'
]);
和其他许多人
array(
'error' => 'invalid_request',
'error_description' => 'Request field validation failed.',
'error_details' =>
array(
'usernames' => 'usernames is required'
),
'status' => 'error'
)