lib/flexirest/request.rb in flexirest-1.4.5 vs lib/flexirest/request.rb in flexirest-1.4.6

- old
+ new

@@ -247,10 +247,13 @@ params = @explicit_parameters end if http_method == :get @get_params = default_params.merge(params || {}) @post_params = nil + elsif http_method == :delete && @method[:options][:send_delete_body] + @post_params = default_params.merge(params || {}) + @get_params = {} else @post_params = default_params.merge(params || {}) @get_params = {} end @@ -333,19 +336,19 @@ end end def prepare_request_body(params = nil) if proxy == :json_api - if http_method == :get || http_method == :delete + if http_method == :get || (http_method == :delete && !@method[:options][:send_delete_body]) @body = "" else headers["Content-Type"] ||= "application/vnd.api+json" @body = JsonAPIProxy::Request::Params.create(params || @post_params || {}, @object).to_json end headers["Accept"] ||= "application/vnd.api+json" JsonAPIProxy::Headers.save(headers) - elsif http_method == :get || http_method == :delete + elsif http_method == :get || (http_method == :delete && !@method[:options][:send_delete_body]) @body = "" elsif request_body_type == :form_encoded @body ||= (params || @post_params || {}).to_query headers["Content-Type"] ||= "application/x-www-form-urlencoded" elsif request_body_type == :json