HTTPCommunication

In Chapter 3, we saw how the HTTPCommunication class could be used as a single source for all HTTP communication to ensure that a consistent approach is applied throughout the framework. We created this class with a single method called {connect}, which was used to create a connection to a server-side Web page and accept back the response. Now we will add another method to its API, as shown in the code listing in Figure 9-12.

The {open-link} method has a single argument called page-name, which represents the page resource being opened. The method first checks the AppParameters setting to determine if the framework is running against a Web server or the local filesystem, and then creates the correct address String syntax. This ...

Get Enterprise Curl now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.