diff options
Diffstat (limited to 'lib/Net/HTTP')
-rw-r--r-- | lib/Net/HTTP/Spore/Meta/Method.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Net/HTTP/Spore/Meta/Method.pm b/lib/Net/HTTP/Spore/Meta/Method.pm index b3a0c6a..1a04eca 100644 --- a/lib/Net/HTTP/Spore/Meta/Method.pm +++ b/lib/Net/HTTP/Spore/Meta/Method.pm @@ -17,7 +17,7 @@ subtype UriPath => where { $_ =~ m!^/! } => message {"path must start with /"}; -enum Method => qw(OPTIONS HEAD GET POST PUT DELETE TRACE); +enum Method => qw(OPTIONS HEAD GET POST PUT DELETE TRACE PATCH); subtype 'JSON::XS::Boolean' => as 'JSON::XS::Boolean'; subtype 'JSON::PP::Boolean' => as 'JSON::PP::Boolean'; @@ -145,10 +145,10 @@ sub wrap { : delete $method_args{payload}; if ( $payload - && ( $method->method !~ /^P(?:OS|U)T$/i ) ) + && ( $method->method !~ /^(?:POST|PUT|PATCH)$/i ) ) { die Net::HTTP::Spore::Response->new( 599, [], - { error => "payload requires a PUT or POST method" }, + { error => "payload requires a PUT, PATCH or POST method" }, ); } |