@ FFDCIgnore ( SocialLoginException . class ) @ Sensitive public Map < String , Object > executeRequest ( SocialLoginConfig config , String requestMethod , String authzHeaderString , String url , String endpointType , String verifierValue ) { if ( endpointType == null ) { endpointType = TwitterConstants . TWITTER_ENDPOINT_REQUEST_TOKEN ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "A Twitter endpoint path was not found; defaulting to using " + endpointType + " as the Twitter endpoint path." ) ; } } try { SocialUtil . validateEndpointWithQuery ( url ) ; } catch ( SocialLoginException e ) { return createErrorResponse ( e ) ; } StringBuilder uri = new StringBuilder ( url ) ; if ( endpointType . equals ( TwitterConstants . TWITTER_ENDPOINT_VERIFY_CREDENTIALS ) ) { // Include the include_email and skip_status parameters for these endpoint requests uri . append ( "?" ) . append ( TwitterConstants . PARAM_INCLUDE_EMAIL ) . append ( "=" ) . append ( TwitterConstants . INCLUDE_EMAIL ) . append ( "&" ) . append ( TwitterConstants . PARAM_SKIP_STATUS ) . append ( "=" ) . append ( TwitterConstants . SKIP_STATUS ) ; } try { Map < String , Object > result = getEndpointResponse ( config , uri . toString ( ) , requestMethod , authzHeaderString , endpointType , verifierValue ) ; String responseContent = httpUtil . extractTokensFromResponse ( result ) ; return evaluateRequestResponse ( responseContent , endpointType ) ; } catch ( SocialLoginException e ) { return createErrorResponse ( "TWITTER_EXCEPTION_EXECUTING_REQUEST" , new Object [ ] { url , e . getLocalizedMessage ( ) } ) ; } }
Sends a request to the specified Twitter endpoint and returns a Map object containing the evaluated response .