SAP NetWeaver '04

com.sapportals.wcm.util.http
Class HttpRequest

[contained in: com.sap.netweaver.bc.util.par - bc.util.public_api.jar]
java.lang.Object
  |
  +--com.sapportals.wcm.util.http.HttpRequest
All Implemented Interfaces:
IRequest

public class HttpRequest
extends java.lang.Object
implements IRequest

Implements IRequest interface for HTTP requests.

Copyright (c) SAP AG 2001-2002


Constructor Summary
HttpRequest()
           
HttpRequest(IUriReference ref)
           
HttpRequest(java.lang.String uri)
           
 
Method Summary
 void addHeader(java.lang.String name, java.lang.String value)
          Add header field for request.
 void clear()
           
 boolean expectsResponseDocument()
           
 void expectsResponseDocument(boolean itDoes)
           
 boolean expectsResponseStream()
           
 void expectsResponseStream(boolean itDoes)
           
 java.lang.String getBody()
           
 java.io.InputStream getBodyStream()
           
 java.lang.String getContentType()
           
 java.lang.String getHeader(java.lang.String name)
           
 java.util.Iterator getHeaderNames()
           
 java.lang.String getMethod()
           
 IUriReference getReference()
           
 java.lang.String getURI()
           
 boolean hasBody()
           
 void removeBody()
           
 void removeHeader(java.lang.String name)
           
 void setBody(java.io.InputStream stream)
           
 void setBody(java.lang.String body)
           
 void setContentLength(long length)
           
 void setContentType(java.lang.String mimeType)
           
 void setHeader(java.lang.String name, java.lang.String value)
          Set header field for request.
 void setMethod(java.lang.String name)
           
 void setURI(IUriReference ref)
           
 void setURI(java.lang.String uri)
           
 boolean wasAddedHeader(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpRequest

public HttpRequest()

HttpRequest

public HttpRequest(java.lang.String uri)

HttpRequest

public HttpRequest(IUriReference ref)
Method Detail

clear

public void clear()

expectsResponseDocument

public boolean expectsResponseDocument()
Specified by:
expectsResponseDocument in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
if the request expects a XML Document in response

expectsResponseDocument

public void expectsResponseDocument(boolean itDoes)

expectsResponseStream

public boolean expectsResponseStream()
Specified by:
expectsResponseStream in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
if the request expects an InputStream for the response body

expectsResponseStream

public void expectsResponseStream(boolean itDoes)

getBody

public java.lang.String getBody()
Specified by:
getBody in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
the body of the request as string or null

getBodyStream

public java.io.InputStream getBodyStream()
Specified by:
getBodyStream in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
the body of the request as input stream or null

getContentType

public java.lang.String getContentType()

getHeader

public java.lang.String getHeader(java.lang.String name)
Specified by:
getHeader in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
header information for given name (or null).

getHeaderNames

public java.util.Iterator getHeaderNames()
Specified by:
getHeaderNames in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
all headers set for the request

getMethod

public java.lang.String getMethod()
Specified by:
getMethod in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
method of request

getURI

public java.lang.String getURI()
Specified by:
getURI in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
URI used for request relative to base URL of requester

getReference

public IUriReference getReference()
Specified by:
getReference in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
Uri reference used for request relative to base URL of requester

hasBody

public boolean hasBody()
Specified by:
hasBody in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Returns:
if a body has been set for the request

setBody

public void setBody(java.lang.String body)

setBody

public void setBody(java.io.InputStream stream)

removeBody

public void removeBody()

setContentType

public void setContentType(java.lang.String mimeType)

setContentLength

public void setContentLength(long length)

addHeader

public void addHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: IRequest
Add header field for request. Will keep any existing header information with the same name.
Specified by:
addHeader in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Parameters:
name - name of header field
value - value of header field

setHeader

public void setHeader(java.lang.String name,
                      java.lang.String value)
Description copied from interface: IRequest
Set header field for request. Replaces any existing header information with the same name.
Specified by:
setHeader in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Parameters:
name - name of header field
value - value of header field

removeHeader

public void removeHeader(java.lang.String name)

setMethod

public void setMethod(java.lang.String name)

setURI

public void setURI(java.lang.String uri)

setURI

public void setURI(IUriReference ref)

wasAddedHeader

public boolean wasAddedHeader(java.lang.String name)
Specified by:
wasAddedHeader in interface IRequest
Following copied from interface: com.sapportals.wcm.util.http.IRequest
Parameters:
name - TBD: Description of the incoming method parameter
Returns:
if header information for name was added (using comma as separator)

SAP NetWeaver '04

Copyright © 2004 by SAP AG. All Rights Reserved.
SAP, R/3, mySAP, mySAP.com, xApps, xApp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.