HTTP Request Method and Common Properties according to RFC 7231


` use HTTP::Method;

# prefered instantiation
my $get_mth = HTTP::Method->GET;

# or from string
my $str_mth = HTTP::Method->new(uc 'get');

# testing
if ( $mth->is_GET ) { ... }

# introspection



There is a lot to say about HTTP Methods in [RFC 7231 Section 4. Request Methods] ( Most of the developers make the wrong assumption that it is just a 'uppercase string'. This module will help writing better code as it does validation and ensures right capitalization for the HTTP Method names.

As one could read in [RFC 7231 Section 4.2 Common Method Properties] (| HTTP Methods do have properties and can be divided in: Safe Methods, Idempotent Methods and Cacheable Methods. These properties are just predicate methods on a HTTP::Method object