com.sapportals.wcm.util.http
Class HttpRequest
java.lang.Object
com.sapportals.wcm.util.http.HttpRequest
- All Implemented Interfaces:
- IRequest
public class HttpRequest
- extends Object
- implements IRequest
Implements IRequest interface for HTTP requests.
Copyright (c) SAP AG 2001-2005
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HttpRequest
public HttpRequest()
HttpRequest
public HttpRequest(String uri)
HttpRequest
public HttpRequest(IUriReference ref)
clear
public void clear()
expectsResponseDocument
public boolean expectsResponseDocument()
- Specified by:
expectsResponseDocument in interface 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
- Returns:
- if the request expects an InputStream for the response body
expectsResponseStream
public void expectsResponseStream(boolean itDoes)
getBody
public String getBody()
- Specified by:
getBody in interface IRequest
- Returns:
- the body of the request as string or null
getBodyStream
public InputStream getBodyStream()
- Specified by:
getBodyStream in interface IRequest
- Returns:
- the body of the request as input stream or null
getContentType
public String getContentType()
getHeader
public String getHeader(String name)
- Specified by:
getHeader in interface IRequest
- Parameters:
name - TBD: Description of the incoming method parameter
- Returns:
- header information for given name (or null).
getHeaderNames
public Iterator getHeaderNames()
- Specified by:
getHeaderNames in interface IRequest
- Returns:
- all headers set for the request
getMethod
public String getMethod()
- Specified by:
getMethod in interface IRequest
- Returns:
- method of request
getURI
public String getURI()
- Specified by:
getURI in interface IRequest
- Returns:
- URI used for request relative to base URL of requester
getReference
public IUriReference getReference()
- Specified by:
getReference in interface IRequest
- Returns:
- Uri reference used for request relative to base URL of requester
hasBody
public boolean hasBody()
- Specified by:
hasBody in interface IRequest
- Returns:
- if a body has been set for the request
setBody
public void setBody(String body)
setBody
public void setBody(InputStream stream)
removeBody
public void removeBody()
setContentType
public void setContentType(String mimeType)
setContentLength
public void setContentLength(long length)
addHeader
public void addHeader(String name,
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
- Parameters:
name - name of header fieldvalue - value of header field
setHeader
public void setHeader(String name,
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
- Parameters:
name - name of header fieldvalue - value of header field
removeHeader
public void removeHeader(String name)
setMethod
public void setMethod(String name)
setURI
public void setURI(String uri)
setURI
public void setURI(IUriReference ref)
wasAddedHeader
public boolean wasAddedHeader(String name)
- Specified by:
wasAddedHeader in interface IRequest
- Parameters:
name - TBD: Description of the incoming method parameter
- Returns:
- if header information for name was added (using comma as separator)
This class can be accessed from:
|
SC
|
DC
|
Public Part
|
ACH
|
[sap.com] KMC-CM
|
[sap.com] tc/km/frwk
|
api
|
EP-KM-CM
|
[sap.com] KMC-WPC
|
[sap.com] tc/kmc/wpc/wpcfacade
|
api
|
EP-PIN-WPC-WCM
|
Copyright 2014 SAP AG Complete Copyright Notice