def set_up_post_request(uri, data, headers, binary_key = nil)
      if !binary_key.nil?
        binary_data = data[binary_key]

        if binary_data.is_a?(StringIO)
          data[binary_key] = UploadIO.new(
            binary_data, "text/plain", "local.path"
          )
        else
          data[binary_key] = UploadIO.new(
            File.open(binary_data), "text/plain"
          )
        end

        req = Net::HTTP::Post::Multipart.new(uri.path, data)
      else
        req = Net::HTTP::Post.new(uri.path, headers)
        req.set_form_data(data)
      end
      req
    end
def set_up_post_request(uri, data, headers, binary_key = nil)
      if !binary_key.nil?
        binary_data = data[binary_key]

        if binary_data.is_a?(StringIO)
          data[binary_key] = UploadIO.new(
            binary_data, "text/plain", "local.path"
          )
        else
          data[binary_key] = UploadIO.new(
            File.open(binary_data), "text/plain"
          )
        end

        req = Net::HTTP::Post::Multipart.new(uri.path, data)
      else
        req = Net::HTTP::Post.new(uri.path, headers)
        req.set_form_data(data)
      end
      req
    end
set up our post request