I am new to OAuth concept, I am trying to achieve this
I need to hit a Url with consumer key, consumer secret, user token and user secret using HttpsURLConnection
Here is my code snippet:
String endpointURL = "some_dummy_url";
URL url = new URL(endpointURL);
connection = (HttpsURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setReadTimeout(10000);
connection.setConnectTimeout(15000);
connection.setRequestProperty("Content-Type", "application-json");
connection.setDoInput(true);
connection.setDoOutput(true);
String consumerKey = getConsumerKey();
String consumerSecret = getConsumerSecret();
String usertoken = getUserToken();
String userSecret = getUserTokenSecret();
connection.setRequestProperty("Authorization", //pass the tokens);
connection.connect();