Programming Reference

This section summarizes many of the more useful functions defined by the server. These tables are not complete, however. You are encouraged to read through the code to learn more about the features offered by the server.

Table 18-1 summarizes the Httpd functions used when returning pages to the client.

Table 18-1. Httpd support procedures.
Httpd_Error sock codeReturns a simple error page to the client. The code is a numeric error code like 404 or 500.
Httpd_ReturnData sock type dataReturns a page with Content-Type type and content data.
Httpd_ReturnFile sock type fileReturns a file with Content-Type type.
Httpd_Redirect newurl sockGenerates a 302 error return with a Location of newurl.
Httpd_SelfUrl urlExpands url to include ...

Get Practical Programming in Tcl & Tk, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.