private Identity fetch ( final String token ) throws IOException { final String uri = new Href ( this . api ) . path ( "user" ) . with ( PsGithub . ACCESS_TOKEN , token ) . toString ( ) ; return PsGithub . parse ( new JdkRequest ( uri ) . header ( "accept" , "application/json" ) . fetch ( ) . as ( RestResponse . class ) . assertStatus ( HttpURLConnection . HTTP_OK ) . as ( JsonResponse . class ) . json ( ) . readObject ( ) ) ; }
Get user name from Github with the token provided .