mod_perl: The Apache Request Object
- Introduction
- The Apache Request Object
- The HTTP Request Message
- The Client Request
- Accessing Client Request Headers
- Accessing HTML Form Fields
- Reading POSTed Data Manually
- Manipulating Cookies
- Handling File Uploads
- Setting Server Response Headers
- Controlling Caching Behavior
- Sending Server Response Headers
- Setting the Response Status
- Setting Error Headers
- Manipulating Headers with Multiple Like Fields
- Using Subrequests
- Setting Headers for Subrequests
- Short-Circuiting Subrequests
- Getting or Setting the Request Method
- Accessing the Request Object from XS
Introduction
At the heart of the Apache API is the request record, defined in the file src/include/httpd.h in the Apache source distribution. The request record contains information about the current request, such as incoming and outgoing HTTP headers, the relationship of the current request to any subrequests, the request URI, resulting physical filename, and more. We highly recommend that you spend a moment going through httpd.hcontained within are many of the minor details of Apache that you will not find documented anywhere else.
For mod_perl, access to the request record is granted through the instantiation of the Apache request object and a handful of methods provided by the Apache class. The request object is the key that releases the Apache request record, and with it you can begin to harness the full power of the mod_perl API.