public function updateMetadata(Object $obj) {
    //$url = $this->url . '/' . rawurlencode($obj->name());
    $url = self::objectUrl($this->url, $obj->name());
    $headers = array();

    // See if we have any metadata. We post this even if there
    // is no metadata.
    $md = $obj->metadata();
    if (!empty($md)) {
      $headers = self::generateMetadataHeaders($md, Container::METADATA_HEADER_PREFIX);
    }
    $headers['X-Auth-Token'] = $this->token;

    // In spite of the documentation's claim to the contrary,
    // content type IS reset during this operation.
    $headers['Content-Type'] = $obj->contentType();

    $client = \HPCloud\Transport::instance();

    // The POST verb is for updating headers.
    $response = $client->doRequest($url, 'POST', $headers, $obj->content());

    if ($response->status() != 202) {
      throw new \HPCloud\Exception('An unknown error occurred while saving: ' . $response->status());
    }
    return TRUE;
  }