private String fetch ( ) throws IOException { return this . token . method ( "POST" ) . header ( "Content-Type" , "application/x-www-form-urlencoded;charset=UTF-8" ) . header ( "Authorization" , String . format ( "Basic %s" , DatatypeConverter . printBase64Binary ( new Utf8String ( String . format ( "%s:%s" , this . app , this . key ) ) . asBytes ( ) ) ) ) . fetch ( ) . as ( RestResponse . class ) . assertStatus ( HttpURLConnection . HTTP_OK ) . as ( JsonResponse . class ) . json ( ) . readObject ( ) . getString ( PsTwitter . ACCESS_TOKEN ) ; }
Retrieve Twitter access token .