FileDocCategorySizeDatePackage
RequestDate.javaAPI DocAndroid 1.5 API2597Wed May 06 22:41:10 BST 2009org.apache.http.protocol

RequestDate

public class RequestDate extends Object implements HttpRequestInterceptor
A request interceptor that adds a Date header. For use on the client side.
author
Oleg Kalnichevski
version
$Revision: 555989 $
since
4.0

Fields Summary
private static final HttpDateGenerator
DATE_GENERATOR
Constructors Summary
public RequestDate()

 
    
      
        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.");
        }
        if ((request instanceof HttpEntityEnclosingRequest) &&
            !request.containsHeader(HTTP.DATE_HEADER)) {
            String httpdate = DATE_GENERATOR.getCurrentDate();
            request.setHeader(HTTP.DATE_HEADER, httpdate); 
        }