private <T> T executeElement(RequestAnswer<?> requestAnswer)
throws IOException {
// Strings
if (requestAnswer.getRequestType() == RequestType.STRING_GET) {
return (T) new EasyStringsHttpClient().get(requestAnswer.getUrl());
} else if (requestAnswer.getRequestType() == RequestType.STRING_POST) {
return (T) new EasyStringsHttpClient().post(requestAnswer.getUrl(),
(String) requestAnswer.getContentToSend());
} else if (requestAnswer.getRequestType() == RequestType.STRING_PUT) {
return (T) new EasyStringsHttpClient().put(requestAnswer.getUrl(),
(String) requestAnswer.getContentToSend());
}
if (requestAnswer.getRequestType() == RequestType.STRING_DELETE) {
new EasyStringsHttpClient().delete(requestAnswer.getUrl(),
(String) requestAnswer.getContentToSend());
return null;
}
// Json