perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <>
Subject Re: Returning 200 status from my handler
Date Wed, 15 Jan 2014 03:34:22 GMT
Hi John,

> I notice, in the getting started documentation, that I am supposed to return
> Apache2::Const::OK to indicate an HTTP 200 success status

Actually, that's not about sending a HTTP 200 success status.  You
return Apache2::Const::OK to tell httpd that your handler ran

> When I print out other values of
> constants from the same package they seem to have numeric values which
> directly correspond to their respective HTTP status codes.

True, but it's just due to a lack of imagination on the part of the
httpd developers.  The only constants that intentionally contain valid
HTTP status codes are the Apache2::Const::HTTP_* ones.

> However, it strikes me as a extremely bizarre,
> especially when returning Apache2::Const::HTTP_OK, which does evaluate to
> 200, causes Apache2 to response with a canned error response page

Right because you returned something other than HTTP::Const::OK,
meaning your handler failed and httpd should sound the alarm.

I hope that clears it up for you.  This is a common confusion, so
nothing to feel bad about.

- Perrin

View raw message