com.HTTPServiceRequest methods

Methods of the com.HTTPServiceRequest class.

Table 1. Object methods: Request URLs
Name Description
getURL()
  RETURNS STRING
Returns the URL of the HTTP service request. The URL may consists of a host name, a port number, a path, and a query.
getURLHost()
  RETURNS STRING
Returns the host name contained in the URL of a HTTP service request.
getURLPath()
  RETURNS STRING
Returns the path contained in the URL of a HTTP service request.
getURLPort()
  RETURNS INTEGER
Returns the port number contained in the URL of a HTTP service request.
getURLQuery(
   query RECORD)
Takes a dynamic array of RECORD of two strings and fills that array with the decoded query string of a HTTP service request.
Table 2. Object methods: Request headers
Name Description
getRequestHeader(
   name STRING )
  RETURNS STRING
Returns the value of an HTTP header.
getRequestHeaderCount()
  RETURNS INTEGER
Returns number of request headers.
getRequestHeaderName(
   ind INTEGER )
  RETURNS STRING
Returns a request header name by position.
getRequestHeaderValue(
   ind INTEGER )
  RETURNS STRING
Returns a request header value by position.
getRequestVersion()
  RETURNS STRING
Returns the HTTP version of the service request.
Table 3. Object methods: Request body
Name Description
beginXmlRequest()
  RETURNS xml.StaxReader
Starts an HTTP streaming request.
endXmlRequest(
   stax xml.StaxReader )
Terminates an HTTP streaming request.
getMethod()
  RETURNS STRING
Returns the HTTP method of the service request.
hasRequestKeepConnection()
  RETURNS INTEGER
Returns TRUE if the connection remains after sending a response.
readDataRequest(
  b BYTE)
Returns the body of a request into a BYTE.
readFileRequest( )
    RETURNS STRING
Returns the body of a request into a file.
readFormEncodedRequest(
   utf8 INTEGER )
  RETURNS STRING
Returns the string of a GET request with UTF-8 conversion option.
readTextRequest()
  RETURNS STRING
Returns the request body as a plain string.
readXmlRequest()
  RETURNS xml.DomDocument
Returns the request body as an XML document.
Table 4. Object methods: Request multipart
Name Description
getRequestMultipartType()
  RETURNS STRING
Returns the multipart type of an incoming request.
getRequestPart(
   pos INTEGER)
  RETURNS com.HTTPPart
Returns the HTTPPart object at the specified index position.
getRequestPartCount()
  RETURNS INTEGER
Returns the number of additional multipart elements.
getRequestPartFromID(
   id STRING)
  RETURNS com.HTTPPart
Returns the HTTPPart object of the given Content-ID value.
Table 5. Object methods: Response header
Name Description
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 6. Object methods: Response body
Name Description
beginXmlResponse(
   code INTEGER,
   description STRING )
  RETURNS xml.StaxWriter
Starts an HTTP streaming response.
endXmlResponse(
   stax xml.StaxWriter )
Terminates an HTTP streaming response.
sendResponse(
   code INTEGER,
   description STRING )
Sends and HTTP response without body.
sendDataResponse(
   code INTEGER,
   description STRING,
   b BYTE )
Sends an HTTP response with data of a BYTE variable.
sendFileResponse(
   code INTEGER,
   description STRING,
   filename STRING )
Sends an HTTP response with the data contained in a file.
sendTextResponse(
   code INTEGER,
   description STRING,
   txt STRING )
Sends and HTTP response with data from a plain string.
sendXmlResponse(
   code INTEGER,
   desc STRING,
   doc xml.DomDocument )
Sends and HTTP response with data from a XML document object.
Table 7. Object methods: Response multipart
Name Description
addResponsePart(
   part com.HTTPPart)
Adds a new part to the HTTP root part response.
setResponseMultipartType(
   type STRING,
   start STRING,
   boundary STRING )
Sets HTTP response in multipart mode of given type.
Table 8. Object methods: Cookie management
Name Description
findRequestCookie(
   name STRING)
  RETURNS STRING
Enables the server to retrieve a cookie sent by the client by name.
setResponseCookies(
   cookies WSHelper.WSServerCookiesType )
Allows the server to return cookies to be set on the client application sending the request.