3 namespace app\Github\API\Users
;
5 use app\Github\API\Call
;
6 use app\Github\Exception\RequestException
;
7 use http\Client\Request
;
8 use http\Client\Response
;
11 class ReadAuthToken
extends Call
13 protected function request() {
14 $request = new Request("POST", "https://github.com/login/oauth/access_token", [
15 "Accept" => "application/json",
17 $request->getBody()->append(new QueryString($this->args
));
21 protected function response(Response
$response) {
22 if ($response->getResponseCode() >= 400 ||
null === ($json = json_decode($response->getBody()))) {
23 throw new RequestException($response);
28 function getCacheKey() {