* @return Response object.
*/
private Response getApiResponse(Verbs verb, String methodName, Map<String, String> params) throws IOException {
Response response = null;
String apiResourceUrl = Constants.API_URL + methodName;
OAuthRequest request = new OAuthRequest(verb, apiResourceUrl);
// Additional parameters in url
if (params != null) {
for (Map.Entry<String, String> entry : params.entrySet()) {
if (verb == Verbs.GET) {
request.addQuerystringParameter(entry.getKey(), entry.getValue());
}
else {
request.addBodyParameter(entry.getKey(), entry.getValue());
}
}
}
response = request.send();
return response;
}