lib/mudbug.rb in mudbug-0.5.2.1 vs lib/mudbug.rb in mudbug-0.6.0.1
- old
+ new
@@ -126,11 +126,12 @@
# if payload is a String, then assume it's already JSON
# otherwise apply #to_json to payload automatically. Quack.
#
[:post, :put].each { |meth|
define_method(meth) { |path, payload, options={}|
+ options[:content_type] ||= CONTENT[:json][:type]
payload = payload.to_json unless payload.is_a?(String)
res = resource(path, options)
- self.class.process(res.send(meth, payload), res.heads[:accept])
+ self.class.process(res.send(meth, payload), res.headers[:accept])
}
}
end