class Kickbox::HttpClient::RequestHandler

RequestHandler takes care of encoding the request body into format given by options

Public Class Methods

set_body(options) click to toggle source
# File lib/kickbox/http_client/request_handler.rb, line 8
def self.set_body(options)
  type = options.fetch(:request_type, "raw")

  # Raw body
  if type == "raw"
    options[:body] = options[:body].is_a?(Hash) ? "" : options[:body]
    options[:headers].delete("content-type")
  end

  return options
end