All Resources All frames

# HttpManager

The HttpManager is the class that handles HTTP requests, and gets back HTTP replies. It a highly configurable engine, both by extending it in Java, and by a rich set of supported properties.

## Properties

The HttpManager uses the following properties (when defined):

- org.w3c.www.protocol.http.filters
- org.w3c.www.protocol.http.cacheControl.maxStale
- org.w3c.www.protocol.http.cacheControl.minFresh
- org.w3c.www.protocol.http.cacheControl.onlyIfCached
- org.w3c.www.protocol.http.userAgent
- org.w3c.www.protocol.http.accept
- org.w3c.www.protocol.http.acceptLanguage
- org.w3c.www.protocol.http.acceptEncoding
- proxySet
- proxyHost
- proxyPort

`org.w3c.www.protocol.http.filters`

semantics
  List the filters to apply globally to all requests. The Jigsaw HTTP client API comes with the notion of filters. Filters can be registered either globally (as is the case when you use this property), or locally (when using the Java API). Local filters are filters that are applied only to a given sub-domain of URLs. To understand the difference between global and local filters, consider the case of authentication.
Authentication is handled by a global filter, that will intercept any reply requiring credential information. When such a reply is intercepted, the global AuthFilter prompts the user for a user name and password. It then retries the request and if it succeed, it installs a local filter on the sub-domain of protected URLs.
The currently available filters are:

org.w3c.www.protocol.http.DebugFilter
  Will print all outgoing requests to the standard output, along with all incoming replies. Very useful for debugging, as the name says.
org.w3c.www.protocol.http.cookies.CookieFilter
  The cookie filter. This filter manage cookies, search and send cookies relative to each url requested.
org.w3c.www.protocol.http.cache.CacheFilter
  A full caching module for HTTP. This filter will maintain a cache of least recently accessed resources, and will use it to serve requests when possible, thus avoiding network access.
org.w3c.www.protocol.http.auth.AuthFilter
  The authentication filter. Handles only Basic authentication for the time being, but will soon be improved to handle Digest authentication too.

default value
  This property has no default value. A typical setting of that property looks like:
`org.w3c.www.protocol.http.filters=org.w3c.www.protocol.http.DebugFilter|org.w3c.www.protocol.http.auth.AuthFilter|org.w3c.www.protocol.http.cache.CacheFilter`

`org.w3c.www.protocol.http.cacheControl.maxStale`

semantics
  This property controls cache usage. It allows the HTTP client side API to advertise the maximum staleness of cached documents it is willing to accept. This property should be set to a number of seconds, any cache (either local, or proxy) will be able to return stale responses when this property is set to a value greater than `0`.
default value
  This property has no default value.

`org.w3c.www.protocol.http.cacheControl.minFresh`

semantics
  This property controls cache usage. It indicates to the HTTP client side API to advertise a minimum freshness value for cached documents. This property should be set to a number of seconds. Any cache (either local or remote) will be allowed to use cache entries, only if the document will remain fresh for the given number of seconds.
default value
  This property has no default value.

`org.w3c.www.protocol.http.cacheControl.onlyIfCached`

semantics
  This property control cache usage. It indicates to the HTTP client side API to returns only documents if they are available in the cache. This is very useful if you are planning to do some browsing in disconnected mode. Note: a nifty thing to do would be to write a robot to fill in the cache, and then turn your browser or proxy into disconnected mode by setting this property (be sure we will have an HTTP robot available in Java real soon ;-)
This property is boolean: setting the property to any value will enable the feature.
default value
  This property has no default value.

`org.w3c.www.protocol.http.userAgent`

semantics
  This property indicates the `User-Agent` header that the HTTP client API should advertise.
default value
  This property defaults to Jigsaw/1.0a5.

`org.w3c.www.protocol.http.accept`

semantics
  This property indicates the media types the client is willing to deal with. Its value is mapped directly to the `Accept` HTTP header.
default value
  This property defaults to */*.

`org.w3c.www.protocol.http.acceptLanguage`

semantics
  This property indicates what languages the client is willing to receive. Its value is mapped directly to the `Accept-Language` HTTP header.
default value
  This property has no default value.

`org.w3c.www.protocol.http.acceptEncoding`

semantics
  This property indicates what encodings the client is willing to deal with. Its value is mapped directly to the `Accept-Encoding` HTTP header.
default value
  This property has no default value.

`proxySet`

semantics
  Should the client API set itself in proxy mode. When you set this property, you turn the whole client API to use a proxy. See the `proxyHost` and `proxyPort` properties.
This is a boolean property, setting it to any value will enable the feature.
default value
  This property has no default value.

`proxyHost`

semantics
  The host name of the machine running the proxy to connect to for handling the HTTP protocol.
default value
  This property chas no default value.

`proxyPort`

semantics
  The port number of the HTTP proxy to connect to for handling the HTTP protocol.
default value
  This property has no default value.

Jigsaw Team
$Id: w3c.www.protocol.http.HttpManager.html,v 1.1 1996/09/07 23:45:12 abaird Exp $