aboutsummaryrefslogtreecommitdiffstats
path: root/activeresource/lib/active_resource/connection.rb
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2006-09-01 01:15:10 +0000
committerRick Olson <technoweenie@gmail.com>2006-09-01 01:15:10 +0000
commit7749c9c2200ad190e3f9935c27f09ec9b95227f2 (patch)
tree5ef693429c4511957bee18bf20594b948bb3a249 /activeresource/lib/active_resource/connection.rb
parente278b72bf3238353906a6cb928410aaf712556f4 (diff)
downloadrails-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.rb11
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