FileDocCategorySizeDatePackage
RequestDefaultHeaders.javaAPI DocAndroid 1.5 API2695Wed May 06 22:41:10 BST 2009org.apache.http.client.protocol

RequestDefaultHeaders

public class RequestDefaultHeaders extends Object implements HttpRequestInterceptor
Request interceptor that adds default request headers.
author
Oleg Kalnichevski
version
$Revision: 653041 $
since
4.0

Fields Summary
Constructors Summary
public RequestDefaultHeaders()

        super();
    
Methods Summary
public voidprocess(org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)

        if (request == null) {
            throw new IllegalArgumentException("HTTP request may not be null");
        }
        // Add default headers
        Collection<?> defHeaders = (Collection<?>) request.getParams().getParameter(
                ClientPNames.DEFAULT_HEADERS);
        if (defHeaders != null) {
            for (Object defHeader : defHeaders) {
                request.addHeader((Header) defHeader);
            }
        }