diff options
author | Rick Olson <technoweenie@gmail.com> | 2006-09-01 01:15:10 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2006-09-01 01:15:10 +0000 |
commit | 7749c9c2200ad190e3f9935c27f09ec9b95227f2 (patch) | |
tree | 5ef693429c4511957bee18bf20594b948bb3a249 /activeresource/lib/active_resource/connection.rb | |
parent | e278b72bf3238353906a6cb928410aaf712556f4 (diff) | |
download | rails-7749c9c2200ad190e3f9935c27f09ec9b95227f2.tar.gz rails-7749c9c2200ad190e3f9935c27f09ec9b95227f2.tar.bz2 rails-7749c9c2200ad190e3f9935c27f09ec9b95227f2.zip |
Major updates to ActiveResource, please see changelog and unit tests [Rick Olson]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4890 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activeresource/lib/active_resource/connection.rb')
-rw-r--r-- | activeresource/lib/active_resource/connection.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/activeresource/lib/active_resource/connection.rb b/activeresource/lib/active_resource/connection.rb index cc98645fdc..22689444b2 100644 --- a/activeresource/lib/active_resource/connection.rb +++ b/activeresource/lib/active_resource/connection.rb @@ -33,6 +33,11 @@ module ActiveResource def requests @@requests ||= [] end + + def default_header + class << self ; attr_reader :default_header end + @default_header = { 'Content-Type' => 'application/xml' } + end end def initialize(site) @@ -44,15 +49,15 @@ module ActiveResource end def delete(path) - request(:delete, path) + request(:delete, path, self.class.default_header) end def put(path, body = '') - request(:put, path, body) + request(:put, path, body, self.class.default_header) end def post(path, body = '') - request(:post, path, body) + request(:post, path, body, self.class.default_header) end private |