com.HTTPServiceRequest methods

Methods of the com.HTTPServiceRequest class.

Table 1. Object methods: Reading client requests
Name Description
getURL()
  RETURNING result STRING
Returns the URL of the HTTP service request.
getMethod()
  RETURNING result STRING
Returns the HTTP method of the service request.
getRequestVersion()
  RETURNING result STRING
Returns the HTTP version of the service request.
hasRequestKeepConnection()
  RETURNING result BOOLEAN
Returns TRUE if the connection remains after sending a response.
getRequestHeader()
  RETURNING result STRING
Returns the request header name.
getRequestHeaderCount()
  RETURNING result INTEGER
Returns number of request headers.
getRequestHeaderName(
   index INTEGER )
  RETURNING result STRING
Returns a request header name by position.
getRequestHeaderValue(
   index INTEGER )
  RETURNING result STRING
Returns a request header value by position.
readFormEncodedRequest(
   utf8 BOOLEAN )
  RETURNING result STRING
Returns the string of a GET request with UTF-8 conversion option.
readDataRequest()
  RETURNING result STRING
Returns the body of a request into a BYTE.
readTextRequest()
  RETURNING result STRING
Returns the request body as a plain string.
readXmlRequest()
  RETURNING result xml.DomDocument
Returns the request body as an XML document.
beginXmlRequest()
  RETURNING reader xml.StaxReader
Starts an HTTP streaming request.
endXmlRequest(
   reader xml.StaxReader )
Terminates an HTTP streaming request.
Table 2. Object methods: Responding to the client
Name Description
setResponseCharset(
   charset STRING )
Defines the HTTP response character set.
setResponseVersion(
   version STRING )
Defines the HTTP response version.
setResponseHeader(
   name STRING,
   value STRING )
Defines a header for the HTTP response.
sendDataResponse(
   code INTEGER,
   desc STRING,
   data BYTE )
Sends and HTTP response with data of a BYTE variable.
sendTextResponse(
   code INTEGER,
   desc STRING,
   data STRING )
Sends and HTTP response with data from a plain string.
sendXmlResponse(
   code INTEGER,
   desc STRING,
   data xml.DomDocument )
Sends and HTTP response with data from a XML document object.
sendResponse(
   code INTEGER,
   desc STRING )
Sends and HTTP response without body.
beginXmlResponse(
   code INTEGER,
   desc STRING )
  RETURNING writer xml.StaxWriter
Starts an HTTP streaming response.
endXmlResponse(
   writer xml.StaxWriter )
Terminates an HTTP streaming response.
Table 3. Object methods: Incoming multipart request
Name Description
getRequestMultipartType()
  RETURNING type STRING
Returns the multipart type of an incoming request.
getRequestPartCount()
  RETURNING num INTEGER
Returns the number of additional multipart elements.
getRequestPart(
   idx INTEGER)
  RETURNING part-object com.HTTPPart
Returns the HTTPPart object at the specified index position.
getRequestPartFromContentID(
   id STRING)
  RETURNING part-object com.HTTPPart
Returns the HTTPPart object of the given Content-ID value.
Table 4. Object methods: Outgoing multipart request
Name Description
setResponseMultipartType(
   type STRING,
   start STRING,
   boundary STRING )
Sets HTTP response in multipart mode of given type.
addResponsePart(
   part-object com.HTTPPart)
Adds a new part to the HTTP root part response.