我嘗試使用 OAuth2 在 coinbase 中進行授權: $client = new Client(['cookies' => true]); try { $response = $client->request('POST', $this->urlAccessToken, [ 'headers' => [ 'cache-control' => 'no-cache', 'Content-Type' => 'application/x-www-form-urlencoded' ], 'form_params' => [ 'grant_type' => 'authorization_code', 'code' => $request->code, 'client_id' => $this->clientId, 'client_secret' => $this->clientSecret, 'redirect_uri' => $this->redirectUri ] ]); dd($response->getBody()); } catch (\Exception $e) { return response($e->getMessage(), 400); }在 coinbase 中授權后,我重定向到重定向 URI,當發送請求交換代碼時,我看到錯誤的響應:客戶端錯誤:POST http://www.coinbase.com/oauth/token導致404 Not Found響應:請求無效。您應該使用有效的 POST 參數發出 POST,而不是 GET 請求。欲了解更多信息(截斷...)
1 回答

紅糖糍粑
TA貢獻1815條經驗 獲得超6個贊
問題出在 URL 訪問令牌中,需要https://api.coinbase.com/oauth/token
改用http://www.coinbase.com/oauth/token
。
- 1 回答
- 0 關注
- 153 瀏覽
添加回答
舉報
0/150
提交
取消