aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/request.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/request.rb')
-rwxr-xr-xactionpack/lib/action_controller/request.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index f16a109cc7..216b9262b2 100755
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
@@ -30,6 +30,27 @@ module ActionController
def head?
method == :head
end
+
+
+ def post_format
+ if env['POST_DATA_FORMAT']
+ env['POST_DATA_FORMAT'].downcase.intern
+ else
+ :query_string
+ end
+ end
+
+ def formatted_post?
+ [ :xml, :yaml ].include?(post_format) && post?
+ end
+
+ def xml_post?
+ post_format == :xml && post?
+ end
+
+ def yaml_post?
+ post_format == :yaml && post?
+ end
# Determine originating IP address. REMOTE_ADDR is the standard