def put_object(obj_path, data, opts = {})
      url = obj_url(obj_path)

      opts[:data] = data
      headers = gen_headers(opts)

      cors_headers = gen_cors_headers(opts)
      headers = headers.concat(cors_headers)

      durability_level = opts[:durability_level]
      if durability_level
        raise ArgumentError unless durability_level > 0
        headers.push([ 'Durability-Level', durability_level ])
      end

      content_type = opts[:content_type]
      if content_type
        raise ArgumentError unless content_type.is_a? String
        headers.push([ 'Content-Type', content_type ])
      end

      attempt(opts[:attempts]) do
        result = @client.put(url, data, headers)
        raise unless result.is_a? HTTP::Message

        return true, result.headers if [204, 304].include? result.status
        raise_error(result)
      end
    end
def put_object(obj_path, data, opts = {})
      url = obj_url(obj_path)

      opts[:data] = data
      headers = gen_headers(opts)

      cors_headers = gen_cors_headers(opts)
      headers = headers.concat(cors_headers)

      durability_level = opts[:durability_level]
      if durability_level
        raise ArgumentError unless durability_level > 0
        headers.push([ 'Durability-Level', durability_level ])
      end

      content_type = opts[:content_type]
      if content_type
        raise ArgumentError unless content_type.is_a? String
        headers.push([ 'Content-Type', content_type ])
      end

      attempt(opts[:attempts]) do
        result = @client.put(url, data, headers)
        raise unless result.is_a? HTTP::Message

        return true, result.headers if [204, 304].include? result.status
        raise_error(result)
      end
    end
Initialize a MantaClient instance.

 priv_key_data is data read directly from an SSH private key (i.e. RFC 4716
 format). The method can also accept several optional args: :connect_timeout,
 :send_timeout, :receive_timeout, :disable_ssl_verification and :attempts.
 The timeouts are in seconds, and :attempts determines the default number of
 attempts each method will make upon receiving recoverable errors.

 Will throw an exception if given a key whose format it doesn't understand.
 Uploads object data to Manta to the given path, along with a computed MD5
 hash.

 The path must start with /<user>/stor or /<user/public. Data can be any
 sequence of octets. The HTTP Content-Type stored on Manta can be set
 with an optional :content_type argument; the default is
 application/octet-stream. The number of distributed replicates of an object
 stored in Manta can be set with an optional :durability_level; the default
 is 2.

 Returns true along with received HTTP headers.

 If there was an unrecoverable error, throws an exception. On connection or
 corruption errors, more attempts will be made; the number of attempts can
 be altered by passing in :attempts.