diner - THE HTTP-server for the BeOS
Contents

CGI ]
InlineModuleInvocation ]

Up ]

CGI

The CGI module behaves like the standard demands, except for one speciality:
The CGI application always has to send a complete header or none, if it operates like an HTTP/0.9 server. This means, that if you give header information, you have to start with a line like "HTTP/1.0 200 OK" to tell the client the error that has occured. If you don't do so, the client will fail to read the result.
For more information about CGI in general, please refer to the various descriptions on the internet or in books.

For the advanced programmer who wants to write more complex applications, it is highly suggested to not use this interface, but to write an AddOn instead.

This is a list of the already implemented environment-variables. Some specialties of common servers may be missing. These can be added to the next release on users request:
  • SERVER_NAME
    The server's hostname, DNS alias, or IP address as it would appear in self-referencing URLs.

  • SERVER_SOFTWARE
    The name and version of the information server software answering the request (and running the gateway). For diner, this is something like diner/1.3

  • SERVER_PROTOCOL
    The name and revision of the information protcol this request came in with. For diner, this is something like HTTP/1.0

  • SERVER_PORT
    The port number to which the request was sent.

  • REQUEST_METHOD
    The method with which the request was made. For HTTP, this is "GET", "HEAD", "POST", etc.

  • QUERY_STRING
    The information which follows the ? in the URL which referenced the CGI. This is the query information.

  • REMOTE_HOST
    The hostname making the request. If diner does not have this information, it sets REMOTE_ADDR and leave this unset.

  • REMOTE_ADDR
    The IP address of the remote host making the request.

  • CONTENT_TYPE
    For queries which have attached information, such as HTTP, POST and PUT, this is the content type of the data.

  • CONTENT_LENGTH
    The length of the send content as given by the client.

  • HTTP_USER_AGENT
    The browser the client is using to send the request. General format: software/version library/version.

  • HTTP_REFERER
    The site where the client was before he came here.

  • HTTP_FROM
    The From: header field as given by the client.

  • HTTP_ACCEPT
    The filetypes the client accepts.

  • DOCUMENT_ROOT
    The directory where the requested file is located.

  • PATH_TRANSLATED
    The full path to the requested file.

Copyright © 1997-99 Stegemann & Co., Inc., all rights reserved.
Created: November 29, 1997. Last modified: April 30, 1999.