private List < NameValuePair > getUrlParameters ( String action , String token , String redirectUri ) { List < NameValuePair > urlParameters = new ArrayList < NameValuePair > ( ) ; if ( action == "revoke" ) { urlParameters . add ( new BasicNameValuePair ( "token" , token ) ) ; } else if ( action == "refresh" ) { urlParameters . add ( new BasicNameValuePair ( "refresh_token" , token ) ) ; urlParameters . add ( new BasicNameValuePair ( "grant_type" , "refresh_token" ) ) ; } else { urlParameters . add ( new BasicNameValuePair ( "code" , token ) ) ; urlParameters . add ( new BasicNameValuePair ( "redirect_uri" , redirectUri ) ) ; urlParameters . add ( new BasicNameValuePair ( "grant_type" , "authorization_code" ) ) ; } return urlParameters ; }
Method to build post parameters