Introduction
The Hypertext Transfer Protocol (HTTP) forms the base for the World Wide Web (WWW). Using HTTP's request-response protocol, a client, such as a web browser, can request data from a server. In the World Wide Web, a web browser requests content (HTML, JavaScript, images, and so on.), and then displays the results. In many cases, the content that is returned is fairly static.
Java applications typically differ. In most cases with Java, you will send requests to specialized backend web services for gathering data or updating systems. In both cases, though, the Java coding remains the same.
This chapter covers how to make HTTP requests from Java applications and parse the response data.