Permalink
Browse files

Added support for POST data in form of YAML or XML, which is controll…

…er through the POST_DATA_MARSHAL header

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1304 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent db11abb commit 86d2b2792a50d21462216b18fb63e57a628ca40f @dhh dhh committed May 14, 2005
Showing with 31 additions and 1 deletion.
  1. +30 −0 actionpack/CHANGELOG
  2. +1 −1 actionpack/lib/action_view/base.rb
View
@@ -1,5 +1,35 @@
*SVN*
+* Added support for POST data in form of YAML or XML, which is controller through the POST_DATA_MARSHAL header. Example request:
+
+ POST_DATA_MARSHAL: xml
+ <request><item><content>HelloWorld</content></item></request>
+
+ ...is the same as:
+
+ POST_DATA_MARSHAL: yaml
+ ---
+ item:
+ content: HelloWorld
+
+ ...is the same as:
+
+ item[content]=HelloWorld
+
+ Which in the end turns into { "item" => { "content" => "HelloWorld" } }. This makes it a lot easier to publish REST web services on top of your regular actions (as they won't care).
+
+ Example Curl call:
+
+ curl -H 'POST_DATA_MARSHAL: xml' -d '<request><item><content>KillMeMore</content></item></request>' http://www.example.com/service
+
+ You can query to find out whether a given request came through as one of these types with:
+ - request.post_format? (:query_string, :xml or :yaml)
+ - request.formatted_post? (for either xml or yaml)
+ - request.xml_post?
+ - request.yaml_post?
+
+* Added bundling of XmlSimple by Maik Schmidt
+
* Fixed that render_partial_collection should always return a string (and not sometimes an array, despite <%= %> not caring)
* Added TextHelper#sanitize that can will remove any Javascript handlers, blocks, and forms from an input of HTML. This allows for use of HTML on public sites, but still be free of XSS issues. #1277 [Jamis Buck]
@@ -218,7 +218,7 @@ def pick_rendering_method(template_extension)#:nodoc:
if @@template_handlers[template_extension]
"delegate_render"
else
- (template_extension == "rxml" ? "rxml" : "rhtml") + "_render"
+ (template_extension.to_s == "rxml" ? "rxml" : "rhtml") + "_render"
end
end

0 comments on commit 86d2b27

Please sign in to comment.