In addition to the proxy and model classes, there are two classes called HttpClient and HttpResponse which can be used to send a direct REST request and then process the REST response. These classes underpin the proxy classes. You may want to use these classes if there is no specific method that you want to use in the proxy classes.
The HttpClient class can be used with a local or remote integration node or integration server. When accessing a local integration node or integration server, a Unix Domain Socket or Named Pipe is used.
The HttpClient allows you to use the different REST verbs: GET, POST, PATCH and DELETE on ACE resources:
The HttpResponse class can be used to access the REST response. It can be be used to get the last URL request that was used by the IntegrationNodeProxy or IntegrationServerProxy by using the getUrlPath()
The parseResponseBody() method is useful to get a model representation of the response body, for example:
IntegrationNodeModel intNodeObject = lastHttpResponse.parseResponseBody(IntegrationNodeModel.class);
Example Code using HttpClient and HttpResponse
The following code snippet shows how you can use the HttpClient and HttpResponse classes. It sends a REST request to a Node-owned integration server and uses the IntegrationServerModel class to parse the response. This is the equivalent to using the IntegrationServerProxy class and is shown for comparison. Obviously, it is easier to use the IntegrationServerProxy class as it does the bulk of the work for you!
You may want to use the HttpClient and HttpResponse classes to access deployed resources which do not have proxy classes or models, for example deployed Policies or a specific Message Flow Node in a Message Flow.