org.codehaus.httpcache4j
Class HTTPRequest

java.lang.Object
  extended by org.codehaus.httpcache4j.HTTPRequest

public class HTTPRequest
extends java.lang.Object

Represents a HTTP request. You can use this in a couple of ways:
either manipulating the headers directly, or by using the convenience objects. If you manipulate the headers, and use the convenience objects afterwards, the headers produced by the convenience objects takes precedence.

Author:
Erlend Hamnaberg

Constructor Summary
HTTPRequest(HTTPRequest request)
           
HTTPRequest(java.net.URI requestURI)
           
HTTPRequest(java.net.URI requestURI, HTTPMethod method)
           
 
Method Summary
 HTTPRequest addHeader(Header header)
           
 HTTPRequest addHeader(java.lang.String name, java.lang.String value)
           
 HTTPRequest challenge(Challenge challenge)
           
 HTTPRequest conditionals(Conditionals conditionals)
           
 Headers getAllHeaders()
          Returns all headers with the headers from the Conditionals, Payload and Preferences.
 Challenge getChallenge()
           
 Conditionals getConditionals()
           
 Headers getHeaders()
           
 HTTPMethod getMethod()
           
 Payload getPayload()
           
 Preferences getPreferences()
           
 java.net.URI getRequestURI()
           
 boolean hasPayload()
           
 HTTPRequest headers(Headers headers)
           
 HTTPRequest payload(Payload payload)
           
 HTTPRequest preferences(Preferences preferences)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTTPRequest

public HTTPRequest(java.net.URI requestURI,
                   HTTPMethod method)

HTTPRequest

public HTTPRequest(HTTPRequest request)

HTTPRequest

public HTTPRequest(java.net.URI requestURI)
Method Detail

getRequestURI

public java.net.URI getRequestURI()

getHeaders

public Headers getHeaders()

getAllHeaders

public Headers getAllHeaders()
Returns all headers with the headers from the Conditionals, Payload and Preferences. If you have explicitly set headers on the request that are the same as the Conditionals and Preferences they are overwritten.

Returns:
All the headers

addHeader

public HTTPRequest addHeader(Header header)

addHeader

public HTTPRequest addHeader(java.lang.String name,
                             java.lang.String value)

getConditionals

public Conditionals getConditionals()

conditionals

public HTTPRequest conditionals(Conditionals conditionals)

getMethod

public HTTPMethod getMethod()

getPreferences

public Preferences getPreferences()

preferences

public HTTPRequest preferences(Preferences preferences)

getChallenge

public Challenge getChallenge()

challenge

public HTTPRequest challenge(Challenge challenge)

getPayload

public Payload getPayload()

payload

public HTTPRequest payload(Payload payload)

headers

public HTTPRequest headers(Headers headers)

hasPayload

public boolean hasPayload()


Copyright © 2008-2009. All Rights Reserved.