RequestConfiguration requestConfiguration = new RequestConfiguration( baseUrl, method, target );
return requestConfiguration.createRequest( context );
}
private ClientResponse callService( InternalRequest request ) {
Method requestMethod = method.getAnnotation( HttpTest.class ).method();
ClientResponse result = null;
if( requestMethod.equals( Method.GET ) ) {
result = request.get();
} else if( requestMethod.equals( Method.POST ) ) {
result = request.post();
} else if( requestMethod.equals( Method.DELETE ) ) {
result = request.delete();
} else if( requestMethod.equals( Method.PUT ) ) {
result = request.put();
} else if( requestMethod.equals( Method.HEAD ) ) {
result = request.head();
} else if( requestMethod.equals( Method.OPTIONS ) ) {
result = request.options();
}
return result;
}