# File lib/cloudfiles/container.rb, line 96
    def set_metadata(metadatahash)
      headers = {}
      metadatahash.each{ |key, value| headers['X-Container-Meta-' + CloudFiles.escape(key.to_s.capitalize)] = value.to_s }
      begin
        SwiftClient.post_container(self.connection.storageurl, self.connection.authtoken, escaped_name, headers)
        self.refresh
        true
      rescue ClientException => e
        raise CloudFiles::Exception::NoSuchObject, "Container #{@name} does not exist" if (e.status.to_s == "404")
        raise CloudFiles::Exception::InvalidResponse, "Invalid response code #{e.status}" unless (e.status.to_s =~ /^20/)
      end
    end