com.sapportals.wcm.util.http

Interface IRequest

All Known Implementing Classes:
HttpRequest

public interface IRequest

Interface for HTTP request passed on to a IWDRequester, which performs the request. The request has information about the base URL for all requests. As a consequence all URIs used in requests are relative to the base URL.

Copyright (c) SAP AG 2001-2002


Method Summary
 void addHeader(String name, String value)
          Add header field for request.
 boolean expectsResponseDocument()
           
 boolean expectsResponseStream()
           
 String getBody()
           
 InputStream getBodyStream()
           
 String getHeader(String name)
           
 Iterator getHeaderNames()
           
 String getMethod()
           
 IUriReference getReference()
           
 String getURI()
           
 boolean hasBody()
           
 void setHeader(String name, String value)
          Set header field for request.
 boolean wasAddedHeader(String name)
           
 

Method Detail

getBody

public String getBody()
Returns:
the body of the request as string or null

getBodyStream

public InputStream getBodyStream()
Returns:
the body of the request as input stream or null

getHeader

public String getHeader(String name)
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
header information for given name (or null).

wasAddedHeader

public boolean wasAddedHeader(String name)
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
if header information for name was added (using comma as separator)

getHeaderNames

public Iterator getHeaderNames()
Returns:
all headers set for the request

getMethod

public String getMethod()
Returns:
method of request

getURI

public String getURI()
Returns:
URI used for request relative to base URL of requester

getReference

public IUriReference getReference()
Returns:
Uri reference used for request relative to base URL of requester

hasBody

public boolean hasBody()
Returns:
if a body has been set for the request

expectsResponseDocument

public boolean expectsResponseDocument()
Returns:
if the request expects a XML Document in response

expectsResponseStream

public boolean expectsResponseStream()
Returns:
if the request expects an InputStream for the response body

setHeader

public void setHeader(String name,
                      String value)
Set header field for request. Replaces any existing header information with the same name.

Parameters:
name - name of header field
value - value of header field

addHeader

public void addHeader(String name,
                      String value)
Add header field for request. Will keep any existing header information with the same name.

Parameters:
name - name of header field
value - value of header field


Copyright 2006 SAP AG Complete Copyright Notice