From b2dda517e44565bc72ef119416e2166486a6bdf0 Mon Sep 17 00:00:00 2001 From: Adam Wiggins Date: Wed, 22 Jul 2009 14:54:33 -0700 Subject: [PATCH] accept */* but prefer xml for backward compatibility --- lib/restclient/request.rb | 2 +- spec/request_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/restclient/request.rb b/lib/restclient/request.rb index 71f1b05..b0138f4 100644 --- a/lib/restclient/request.rb +++ b/lib/restclient/request.rb @@ -232,7 +232,7 @@ module RestClient end def default_headers - { :accept => 'application/xml', :accept_encoding => 'gzip, deflate' } + { :accept => '*/*; q=0.5, application/xml', :accept_encoding => 'gzip, deflate' } end end end diff --git a/spec/request_spec.rb b/spec/request_spec.rb index 47842e2..d6c334c 100644 --- a/spec/request_spec.rb +++ b/spec/request_spec.rb @@ -17,8 +17,8 @@ describe RestClient::Request do @net.stub!(:verify_mode=) end - it "requests xml mimetype" do - @request.default_headers[:accept].should == 'application/xml' + it "accept */* mimetype, preferring xml" do + @request.default_headers[:accept].should == '*/*; q=0.5, application/xml' end it "decodes an uncompressed result body by passing it straight through" do