User Documentation

You are a user of HttpComponents if you are developing an application that makes use of our libraries. The documentation linked here is meant to help you understand how to use these libraries.

The General Information section points to documentation that is mostly API agnostic. Here you will find information that is useful, no matter whether you are using the new HttpComponents, or the Commons HttpClient 3.1, or even the standard Java HttpUrlConnection. Of course we put no emphasis on the latter.

The API Specific Information section points to documentation for specific APIs, either the new HttpComponents, or the Commons HttpClient 3.1. Using the information there with other APIs will be tricky, if not impossible.

General Information

If you are just getting started, you'll probably start by retrieving some pages from a web server. The Primer will give you valuable information for that. Once you are tackling more specific use cases, such as sending parameters to a servlet, or configuring a proxy within an applet, some of the FAQs may prove helpful.

  • Client HTTP Programming Primer - The Primer describes how to submit an HTML form to a web server and retrieve the results. HTML forms are often used as login forms, so the Primer also tells you how to perform form-based login in your application.
  • Application Design FAQ - This FAQ addresses problems such as uploading files and configuring proxies based on JVM settings. It also explains the different ways in which a client may authenticate against a server.
  • Connection Management FAQ - This FAQ addresses questions related to connection management, for example where sockets in state TIME_WAIT come from. Although the API is different, connection management in the new HttpClient works similar to that in the Commons HttpClient 3.1. The standard Java HttpUrlConnection also manages connections, though we're not really concerned about that.

API Specific Information

Official tutorials and guides

Example Code

Code contributions

  • HttpCore
  • HttpClient

    Contribution code can provide useful additional functionality or examples. It is not supported, and not shipped with binary release packages.

Commons HttpClient 3.1 (legacy)

  • Tutorial - Explains how to use HttpClient 3.1 in simple scenarios. The concepts still apply to the new HttpClient 4.0, but the API has changed completely.
  • Troubleshooting - Explains how to avoid common errors, and how to report the uncommon ones.
  • User Guide - The HttpClient 3.1 User Guide is a selection of guides for specific topics such as Authentication, Multi-Threaded Applications, SSL, and others.