GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DANCER::HTTP (3)

.ds Aq ’

NAME

Dancer::HTTP - helper for rendering HTTP status codes for Dancer

CONTENTS

VERSION

version 1.3138

DESCRIPTION

Helper for rendering HTTP status codes for Dancer

METHODS

status( CW$status )

Returns the numerical status of $status.



    # all three are equivalent, and will return 405

    $x = Dancer::HTTP->status( 405 );
    $x = Dancer::HTTP->status( Method Not Allowed );
    $x = Dancer::HTTP->status( method_not_allowed );



    codes

Returns a hashref of all HTTP status known to Dancer. The keys are the numerical statuses and the values their string equivalents.



    print Dancer::HTTP->codes->{404}; # prints File Not Found



HTTP CODES

The following codes/aliases are understood by any status() call made from a Dancer script. The aliases can be used as-is (e.g., Moved Permanently), or as lower-case string with all non-alphanumerical characters changed to underscores (e.g., moved_permanently).



    get /user/:user => sub {
        my $user = find_user( param(user) );

        unless ( $user ) {
            status 404;

            # or could be
            status not_found;

            # or even
            status Not Found;
        }

        ...
    };



    Processed Codes

200 - OK
201 - Created
202 - Accepted
204 - No Content
205 - Reset Content
206 - Partial Content

    Redirections

301 - Moved Permanently
302 - Found
304 - Not Modified
306 - Switch Proxy

    Problem with request

400 - Bad Request
401 - Unauthorized
402 - Payment Required
403 - Forbidden
404 - Not Found
405 - Method Not Allowed
406 - Not Acceptable
407 - Proxy Authentication Required
408 - Request Timeout
409 - Conflict
410 - Gone
411 - Length Required
412 - Precondition Failed
413 - Request Entity Too Large
414 - Request-URI Too Long
415 - Unsupported Media Type
416 - Requested Range Not Satisfiable
417 - Expectation Failed

    Problem with server

500 - Internal Server Error Also aliases as ’error’.
501 - Not Implemented
502 - Bad Gateway
503 - Service Unavailable
504 - Gateway Timeout
505 - HTTP Version Not Supported

AUTHOR

This module has been written by Alexis Sukrieh <sukria@cpan.org>

SOURCE CODE

The source code for this module is hosted on GitHub <https://github.com/PerlDancer/Dancer>

LICENSE

This module is free software and is published under the same terms as Perl itself.

AUTHOR

Dancer Core Developers

COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Alexis Sukrieh.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 DANCER::HTTP (3) 2015-06-12

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.