.withUrl(ApiEndpointUtils.REDDIT_BASE_URL + urlPath)
.withCookie(cookie),
convertRequestStringToList(apiParams)
);
if (result == null) {
throw new ActionFailedException("Due to unknown reasons, the response was undefined for URI path: " + urlPath);
} else {
return result;
}
} catch (URISyntaxException e) {
throw new ActionFailedException("The syntax of the URI path was incorrect: " + urlPath);
} catch (IOException e) {
throw new ActionFailedException("Input/output failed when retrieving from URI path: " + urlPath);
} catch (ParseException e) {
throw new ActionFailedException("Failed to parse the response from GET request to URI path: "+ urlPath);
}
}