Home > Articles > Web Development > Perl

mod_perl: The Apache Request Object

  • Print
  • + Share This
Fully grasping the flexibility provided by the mod_perl API is impossible without first understanding the different parts of the HTTP request, how they interact with each other, and how Apache stores this information internally. Randy Kobes, Paul Lindner, and Geoffrey Young discuss fundamentals by introducing the Apache request object, which provides a framework for interacting with all of these.
This sample chapter is excerpted from mod_perl Developer's Cookbook, by Randy Kobes, Paul Lindner, and Geoffrey Young.
This chapter is from the book

This chapter is from the book

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.h—contained 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.

  • + Share This
  • 🔖 Save To Your Account