Common Java Cookbook

Edition: 0.19

Download PDF or Read on Scribd

Download Examples (ZIP)

Chapter 11. HTTP and WebDAV

11.1. Introduction

The Hypertext Transfer Protocol (HTTP) is ubiquitous; this protocol is at the core of important technologies such as the World Wide Web (WWW), the Simple Object Access Protocol (SOAP), XML databases, content management systems, WebDAV, and, most importantly, iTunes. Much of the world's business is accomplished over HTTP in some form or another, and if this protocol were to suddenly vanish, a sizable portion of the world economy would vanish with it. Given this ubiquity, it is likely that you've had occasion to write a Java program that needed to fetch a web page or interact with a servlet or CGI script. While the J2SE contains some rudimentary tools to communicate via HTTP, the feature set of URLConnection is somewhat limited. This chapter introduces Apache HttpClient, a set of utilities that simplifies the task of retrieving and sending information over HTTP.

Apache HttpClient grew up in the Jakarta Commons, and until April 2004 it was a Commons project. It subsequently graduated to a full Jakarta project, and as Jakarta was dismantled, it became an Apache top-level project. This chapter refers to HttpClient as Apache HttpClient, but you should be aware that most of the documentation and support still refer to the project as Commons HttpClient.


Creative Commons License
Common Java Cookbook by Tim O'Brien is licensed under a Creative Commons Attribution-Noncommercial-No Derivative Works 3.0 United States License.
Permissions beyond the scope of this license may be available at http://www.discursive.com/books/cjcook/reference/jakartackbk-PREFACE-1.html. Copyright 2009. Common Java Cookbook Chunked HTML Output. Some Rights Reserved.