Added status_bad_request
adam [Thu, 19 Oct 2006 00:23:16 +0000 (00:23 +0000)]
Changelog
lib/Catalyst/Controller/REST.pm

index f3d2ae8..394952e 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -3,3 +3,7 @@ Mon Oct 16 14:48:54 PDT 2006 (adam)
        Created Catalyst::Action::Serialize and Catalyst::Action::Deserialize
        Added Data::Serializer actions
        Added status_created helper method
+
+Wed Oct 18 17:29:07 PDT 2006 (adam)
+       Added more status_ helpers
+
index 1195f13..33ef165 100644 (file)
@@ -61,6 +61,21 @@ sub status_ok {
     return 1;
 }
 
+sub status_bad_request {
+    my $self = shift;
+    my $c = shift;
+    my %p = validate(@_,
+        {
+            message => { type => SCALAR }, 
+        },
+    );
+
+    $c->response->status(400);
+    $c->response->content_type('text/plain');
+    $c->response->body($p{'message'});
+    return 1;
+}
+
 sub status_not_found {
     my $self = shift;
     my $c = shift;