Built-In Object Type: HTTPService

Inherits All
(MORE DESCRIPTION TO COME.)
Methods:
NameArgumentsDescription
addCookie
cookie
cookieValue
Adds a cookie cookie with value cookieValue to the response headers. This should be called before the response body is sent to the client. If only cookie, it should be a Cookie instance.
close
  Close the connection to the client.
getAllHeaders
  Returns an array of all the header names for the HTTP request.
getContentLength
  Returns the "Content-Length" header of the HTTP reponse. If it is not present, -1 is returned.
getCookies
  Returns an array of Cookie's from the HTTP request.
getDateHeader
name
Returns a date object for the name HTTP request header.
getDomain
  Returns the domain of the URL for the client connection.
getFileName
  Returns the file name of the URL for the client connection.
getHost
  Returns the host of the URL for the client connection.
getInputStream
  Returns the input stream for the client connection.
getMethod
  Returns the HTTP method for the client connection.
getOutputStream
  Returns the output stream for the client connection. This implicitly makes the connection if not connected yet.
getPath
  Returns the path of the URL for the client connection.
getPort
  Returns the port of the URL for the client connection.
getQuery
  Returns the query string of the URL for the client connection.
getRef
  Returns the reference of the URL for the client connection.
getServerName
  Returns this machine's host name.
getServerPort
  Returns this server socket's local port number.
getTextInput
  Returns the text input (a buffered reader) for the client connection.
getTextOutput
  Returns the text output (a print writer) for the client connection. This implicitly makes the connection if not connected yet.
getUrl
  Returns the URL for the client connection.
parseFormVars
  Returns form variables, whether it is posted or in the query string for a GET request, as a struct . Each value is usually a string or a string array.
serveError
code
Sends an error response with code to the client. If no code is specified, defaut to 500.
serveFile
docRoot
Sends the file whose is composed of docRoot and the virtual path of the URL. The mime-type is based on the file extension and the internal mime type table. For unknown extensions, default mime type is "text/plain".
setResponseMessage
setResponseMsg
msg
Sets the HTTP response message to msg for the client connection.
setStatusCode
setStatus
code
Sets the HTTP response code to code for the client connection.