You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-dev@perl.apache.org by Fred Moyer <fr...@taperfriendlymusic.org> on 2006/09/02 08:45:36 UTC

Re: status codes in Apache2::Const ?

>Stas Bekman wrote:
>
> I'd suggest to put the mapping somewhere in the user docs and link from
> the above link there...
>
> Probably somewhere around:
> http://perl.apache.org/docs/2.0/user/handlers/http.html

Here are the proposed diffs.  You can view the html at this url:
http://redhotpenguin.com/mirrors/perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Status_Codes

Stas do I need to add a reference to the modperlbook url this pod snippet
came from?  Comments on this welcome, I'll probably commit it revised
sometime soonish unless anyone has objections.

Index: /usr/local/modperl-docs/src/docs/2.0/api/Apache2/Const.pod
===================================================================
--- /usr/local/modperl-docs/src/docs/2.0/api/Apache2/Const.pod  (revision
396467)
+++ /usr/local/modperl-docs/src/docs/2.0/api/Apache2/Const.pod  (working
copy)
@@ -2583,9 +2583,9 @@

 L<mod_perl 2.0 documentation|docs::2.0::index>.

+L<HTTP Status Codes|docs::2.0::user::handlers::http/HTTP_Status_Codes>.


-
 =head1 Copyright


Index: /usr/local/modperl-docs/src/docs/2.0/user/handlers/http.pod
===================================================================
--- /usr/local/modperl-docs/src/docs/2.0/user/handlers/http.pod (revision
396467)
+++ /usr/local/modperl-docs/src/docs/2.0/user/handlers/http.pod (working
copy)

 Extending HTTP under mod_perl is a trivial task.  Look at L<the
@@ -1788,10 +1793,144 @@
 details.


+=head1 HTTP Status Codes

+The Hypertext Transfer Protocol (HTTP) is an application-level
+protocol for distributed, collaborative, hypermedia information
+systems. It is a generic, stateless, protocol which can be used for
+many tasks beyond its use for hypertext, such as name servers and
+distributed object management systems, through extension of its
+request methods, error codes and headers. A feature of HTTP is the
+typing and negotiation of data representation, allowing systems to be
+built independently of the data being transferred.

+HTTP 1.0 is described in Requests For Comments (RFC) 1945. HTTP 1.1 is
+the latest version of the specifications and as of this writing HTTP
+1.1 is covered in RFC 2616.

+When writing mod_perl applications, usually only a small subset of HTTP
+response codes is used, but sometimes you need to know others as
+well. We will give a short description of each code and you will find
+the extended explanation in the appropriate RFC. (Section 9 in RFC
+1945 and section 10 in RFC 2616). You can always find the latest link
+to these RFCs at the Web Consortium site,
+I<http://www.w3.org/Protocols/>.

+While HTTP 1.1 is widely supported, HTTP 1.0 still remains the
+mainstream standard. Therefore we will supply a summary of the both
+versions including the corresponding Apache constants.
+
+In mod_perl these constants can be accessed the
+C<L<Apache::Constants|docs::1.0::api::Apache::Constants>>
+package (e.g., to access the HTTP_OK constant use
+C<Apache::Constants::HTTP_OK>). See the
+C<L<Apache::Constants|docs::1.0::api::Apache::Constants>> manpage
+for more information.
+
+In mod_perl2 these constants can be accessed the
+C<L<Apache2::Const|docs::2.0::api::Apache2::Const>>
+package (e.g., to access the HTTP_OK constant use
+C<Apache2::Const::HTTP_OK>). See the
+C<L<Apache2::Const|docs::2.0::api::Apache2::Const>> manpage
+for more information.
+
+=head2 HTTP 1.0 Status Codes
+
+
+ Successful 2xx:
+
+ 200 HTTP_OK                    OK
+ 201 HTTP_CREATED               Created
+ 202 HTTP_ACCEPTED              Accepted
+ 204 HTTP_NO_CONTENT            No Content
+
+ Redirection 3xx:
+
+ 300 HTTP_MOVED_PERMANENTLY     Multiple Choices
+ 301 HTTP_MOVED_TEMPORARILY     Moved Permanently
+ 302 HTTP_SEE_OTHER             Moved Temporarily
+ 304 HTTP_NOT_MODIFIED          Not Modified
+
+ Client Error 4xx:
+
+ 400 HTTP_BAD_REQUEST           Bad Request
+ 401 HTTP_UNAUTHORIZED          Unauthorized
+ 403 HTTP_FORBIDDEN             Forbidden
+ 404 HTTP_NOT_FOUND             Not Found
+
+ Server Error 5xx:
+
+ 500 HTTP_INTERNAL_SERVER_ERROR Internal Server Error
+ 501 HTTP_NOT_IMPLEMENTED       Not Implemented
+ 502 HTTP_BAD_GATEWAY           Bad Gateway
+ 503 HTTP_SERVICE_UNAVAILABLE   Service UnavailableStatus Codes
+
+=head2 HTTP 1.1 Status Codes
+
+ Informational 1xx:
+
+ 100 HTTP_CONTINUE                        Continue
+ 101 HTTP_SWITCHING_PROTOCOLS             Switching Protocols
+
+ Successful 2xx:
+
+ 200 HTTP_OK                              OK
+ 201 HTTP_CREATED                         Created
+ 202 HTTP_ACCEPTED                        Accepted
+ 203 HTTP_NON_AUTHORITATIVE               Non-Authoritative Information
+ 204 HTTP_NO_CONTENT                      No Content
+ 205 HTTP_RESET_CONTENT                   Reset Content
+ 206 HTTP_PARTIAL_CONTENT                 Partial Content
+
+ Redirection 3xx:
+
+ 300 HTTP_MULTIPLE_CHOICES                Multiple Choices
+ 301 HTTP_MOVED_PERMANENTLY               Moved Permanently
+ 302 HTTP_MOVED_TEMPORARILY               Found
+ 303 HTTP_SEE_OTHER                       See Other
+ 304 HTTP_NOT_MODIFIED                    Not Modified
+ 305 HTTP_USE_PROXY                       Use Proxy
+ 306                                      (Unused)
+ 307 HTTP_TEMPORARY_REDIRECT              Temporary Redirect
+
+ Client Error 4xx:
+
+ 400 HTTP_BAD_REQUEST                     Bad Request
+ 401 HTTP_UNAUTHORIZED                    Unauthorized
+ 402 HTTP_PAYMENT_REQUIRED                Payment Required
+ 403 HTTP_FORBIDDEN                       Forbidden
+ 404 HTTP_NOT_FOUND                       Not Found
+ 405 HTTP_METHOD_NOT_ALLOWED              Method Not Allowed
+ 406 HTTP_NOT_ACCEPTABLE                  Not Acceptable
+ 407 HTTP_PROXY_AUTHENTICATION_REQUIRED   Proxy Authentication Required
+ 408 HTTP_REQUEST_TIMEOUT                 Request Timeout
+ 409 HTTP_CONFLICT                        Conflict
+ 410 HTTP_GONE                            Gone
+ 411 HTTP_LENGTH REQUIRED                 Length Required
+ 412 HTTP_PRECONDITION_FAILED             Precondition Failed
+ 413 HTTP_REQUEST_ENTITY_TOO_LARGE        Request Entity Too Large
+ 414 HTTP_REQUEST_URI_TOO_LARGE           Request-URI Too Long
+ 415 HTTP_UNSUPPORTED_MEDIA_TYPE          Unsupported Media Type
+ 416 HTTP_RANGE_NOT_SATISFIABLE           Requested Range Not Satisfiable
+ 417 HTTP_EXPECTATION_FAILED              Expectation Failed
+
+ Server Error 5xx:
+
+ 500 HTTP_INTERNAL_SERVER_ERROR           Internal Server Error
+ 501 HTTP_NOT IMPLEMENTED                 Not Implemented
+ 502 HTTP_BAD_GATEWAY                     Bad Gateway
+ 503 HTTP_SERVICE_UNAVAILABLE             Service Unavailable
+ 504 HTTP_GATEWAY_TIME_OUT                Gateway Timeout
+ 505 HTTP_VERSION_NOT_SUPPORTED           HTTP Version Not Supported
+
+=head2 References
+
+All the information related to web protocols can be found at the World
+Wide Web Consortium site, I<http://www.w3.org/Protocols/>.
+
+There are many mirrors of the RFCs all around the world. One of the
+good starting points might be I<http://www.rfc-editor.org/>.
+
 =head1 Maintainers

 Maintainer is the person(s) you should contact with updates,
@@ -1801,7 +1940,7 @@

 =item *

-Stas Bekman E<lt>stas (at) stason.orgE<gt>
+Fred MoyerE<lt>fred(at) taperfriendlymusic.orgE<gt>

 =back

@@ -1812,6 +1951,8 @@

 =item *

+Stas Bekman E<lt>stas (at) stason.orgE<gt>
+
 =back

 Only the major authors are listed above. For contributors s


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: status codes in Apache2::Const ?

Posted by Stas Bekman <st...@stason.org>.
Fred Moyer wrote:
>> Stas Bekman wrote:
>>
>> I'd suggest to put the mapping somewhere in the user docs and link from
>> the above link there...
>>
>> Probably somewhere around:
>> http://perl.apache.org/docs/2.0/user/handlers/http.html
> 
> Here are the proposed diffs.  You can view the html at this url:
> http://redhotpenguin.com/mirrors/perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Status_Codes
> 
> Stas do I need to add a reference to the modperlbook url this pod snippet
> came from?  

Not in this case. I think the original comes from the eagle book.

In general we are trying to keep the documents clean from the reference 
and originator clutter. References could go to the end of the doc or 
something. For acks we have a separate doc.

Thanks for working on this, Fred et al.

-- 
_____________________________________________________________
Stas Bekman    mailto:stas@stason.org http://stason.org/
MailChannels: Reliable Email Delivery http://mailchannels.com
The "Practical mod_perl" book         http://modperlbook.org/
http://www.linkedin.com/in/stasbekman http://perl.apache.org/
http://stason.org/photos/gallery/     [* best photos here *]


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: status codes in Apache2::Const ?

Posted by Fred Moyer <fr...@taperfriendlymusic.org>.
On Sat, 2 Sep 2006, Philip M. Gollucci wrote:

> Fred Moyer wrote:
>>> Stas Bekman wrote:
>>>
>>> I'd suggest to put the mapping somewhere in the user docs and link from
>>> the above link there...
>>>
>>> Probably somewhere around:
>>> http://perl.apache.org/docs/2.0/user/handlers/http.html
>>
>> Here are the proposed diffs.  You can view the html at this url:
>> http://redhotpenguin.com/mirrors/perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Status_Codes
>>
>> Stas do I need to add a reference to the modperlbook url this pod snippet
>> came from?  Comments on this welcome, I'll probably commit it revised
>> sometime soonish unless anyone has objections.
>
> a little after this the intentation is off and thus the resulting HTML (text/code) isn't indented correctly.
> Should be a trivial fix.
>  sub unique_id {
>      require APR::UUID;
>      return APR::UUID->new->format;
>  }

I'm cleaning some small stuff up also.
But you know I've running into problems here and there with getting the code
indented properly, I've been trying to do what you have above there and the
fact that I haven't gotten it yet is really bugging me. The pod source I 
have is

  sub unique_id {
   require APR::UUID;
   return APR::UUID->new->format;
  }

I can't seem to get the second level of indentation needed past the first 
verbatim paragraph.

> I'm not entirely sure, but I think you were trying to have
> lines like 'Successful 2xx:' not show up like code -- I think you meant to un-indent them.
> (could be wrong here)

I actually tried that but the results were not what I expected so I just 
revised it to this style:

=head2 HTTP 1.1 Status Codes

=over 4

=item *

Informational 1xx:

  100...

I'd really like to get figured out how to indent all those code blocks 
properly but it looks like that's an issue in several places in the docs 
so I'm not sure if it's possible.

> Looks fabulous to me.

Thanks!

> P.S.
>  Add yourself to the contributors page and related when you get a chance.
>
> http://perl.apache.org/about/contributors/people.html
>
> (CC'ed fwiles -- I think he needs to do the same)

Will do.

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: status codes in Apache2::Const ?

Posted by Frank Wiles <fr...@wiles.org>.
On Sat, 02 Sep 2006 00:43:31 -0700
"Philip M. Gollucci" <pg...@p6m7g8.com> wrote:

> P.S.
>   Add yourself to the contributors page and related when you get a
> chance.
> 
> http://perl.apache.org/about/contributors/people.html
> 
> (CC'ed fwiles -- I think he needs to do the same)

   Actually I took care of that as my first/test commit. 

 ---------------------------------
   Frank Wiles <fr...@wiles.org>
   http://www.wiles.org
 ---------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org


Re: status codes in Apache2::Const ?

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Fred Moyer wrote:
>> Stas Bekman wrote:
>>
>> I'd suggest to put the mapping somewhere in the user docs and link from
>> the above link there...
>>
>> Probably somewhere around:
>> http://perl.apache.org/docs/2.0/user/handlers/http.html
> 
> Here are the proposed diffs.  You can view the html at this url:
> http://redhotpenguin.com/mirrors/perl.apache.org/docs/2.0/user/handlers/http.html#HTTP_Status_Codes
> 
> Stas do I need to add a reference to the modperlbook url this pod snippet
> came from?  Comments on this welcome, I'll probably commit it revised
> sometime soonish unless anyone has objections.

a little after this the intentation is off and thus the resulting HTML (text/code) isn't indented correctly.
Should be a trivial fix.
  sub unique_id {
      require APR::UUID;
      return APR::UUID->new->format;
  }

I'm not entirely sure, but I think you were trying to have
lines like 'Successful 2xx:' not show up like code -- I think you meant to un-indent them.
(could be wrong here)

Looks fabulous to me.

P.S.
  Add yourself to the contributors page and related when you get a chance.

http://perl.apache.org/about/contributors/people.html

(CC'ed fwiles -- I think he needs to do the same)

-- 
------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant / http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - TicketMaster - http://ticketmaster.com
1024D/A79997FA F357 0FDD 2301 6296 690F  6A47 D55A 7172 A799 97F

"In all that I've done wrong I know I must have done something right to
deserve a hug every morning and butterfly kisses at night."
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /
 / /|_/ / // /\ \/ /_/ / /__
/_/  /_/\_, /___/\___\_\___/
       <___/

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-dev-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-dev-help@perl.apache.org