com.HTTPServiceRequest methods

Methods of the com.HTTPServiceRequest class.

Table 1. Object methods: Reading client requests
Name Description
beginXmlRequest()
  RETURNING reader xml.StaxReader
Starts an HTTP streaming request.
endXmlRequest(
   reader xml.StaxReader )
Terminates an HTTP streaming request.
getMethod()
  RETURNING result STRING
Returns the HTTP method of the service request.
getRequestHeader( name STRING )
  RETURNING result STRING
Returns the value of an HTTP header.
getRequestVersion()
  RETURNING result STRING
Returns the HTTP version of the service request.
getURL()
  RETURNING result STRING
Returns the URL of the HTTP service request.
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.
hasRequestKeepConnection()
  RETURNING result BOOLEAN
Returns TRUE if the connection remains after sending a response.
readDataRequest(
  body BYTE)
Returns the body of a request into a BYTE.
readFileRequest( )
    RETURNING filename STRING
Returns the body of a request into a file.
readFormEncodedRequest(
   utf8 BOOLEAN )
  RETURNING result STRING
Returns the string of a GET request with UTF-8 conversion option.
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.
Table 2. Object methods: Responding to the client
Name Description
beginXmlResponse(
   code INTEGER,
   desc STRING )
  RETURNING writer xml.StaxWriter
Starts an HTTP streaming response.
endXmlResponse(
   writer xml.StaxWriter )
Terminates an HTTP streaming response.
sendDataResponse(
   code INTEGER,
   desc STRING,
   data BYTE )
Sends and HTTP response with data of a BYTE variable.
sendFileResponse(
   code INTEGER,
   desc STRING,
   filepath STRING )
Sends and HTTP response with the data contained in a file.
sendResponse(
   code INTEGER,
   desc STRING )
Sends and HTTP response without body.
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.
setResponseCharset(
   charset STRING )
Defines the HTTP response character set.
setResponseHeader(
   name STRING,
   value STRING )
Defines a header for the HTTP response.
setResponseVersion(
   version STRING )
Defines the HTTP response version.
Table 3. Object methods: Incoming multipart request
Name Description
getRequestMultipartType()
  RETURNING type STRING
Returns the multipart type of an incoming request.
getRequestPart(
   idx INTEGER)
  RETURNING part-object com.HTTPPart
Returns the HTTPPart object at the specified index position.
getRequestPartCount()
  RETURNING num INTEGER
Returns the number of additional multipart elements.
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.