lib/flexirest/request.rb in flexirest-1.5.9 vs lib/flexirest/request.rb in flexirest-1.6.0

- old
+ new

@@ -400,10 +400,14 @@ @body ||= if params.is_a?(String) params elsif @post_params.is_a?(String) @post_params else - (params || @post_params || {}).to_json + if @method[:options][:wrap_root].present? + {@method[:options][:wrap_root] => (params || @post_params || {})}.to_json + else + (params || @post_params || {}).to_json + end end headers["Content-Type"] ||= "application/json; charset=utf-8" end end