func (c *Client) UploadCharm(curl *charm.URL, content io.ReadSeeker) (*charm.URL, error) {
	args := url.Values{}
	args.Add("series", curl.Series)
	args.Add("schema", curl.Schema)
	args.Add("revision", strconv.Itoa(curl.Revision))
	apiURI := url.URL{Path: "/charms", RawQuery: args.Encode()}

	contentType := "application/zip"
	var resp params.CharmsResponse
	if err := c.httpPost(content, apiURI.String(), contentType, &resp); err != nil {
		return nil, errors.Trace(err)
	}

	curl, err := charm.ParseURL(resp.CharmURL)
	if err != nil {
		return nil, errors.Annotatef(err, "bad charm URL in response")
	}
	return curl, nil
}
// UploadCharm sends the content to the API server using an HTTP post.
UploadCharm sends the content to the API server using an HTTP post.
// UploadCharm sends the content to the API server using an HTTP post .
func (c *Client) UploadCharm(curl *charm.URL, content io.ReadSeeker) (*charm.URL, error) {
	args := url.Values{}
	args.Add("series", curl.Series)
	args.Add("schema", curl.Schema)
	args.Add("revision", strconv.Itoa(curl.Revision))
	apiURI := url.URL{Path: "/charms", RawQuery: args.Encode()}
	contentType := "application/zip"
	var resp params.CharmsResponse
	if err := c.httpPost(content, apiURI.String(), contentType, &resp); err != nil {
		return nil, errors.Trace(err)
	}
	curl, err := charm.ParseURL(resp.CharmURL)
	if err != nil {
		return nil, errors.Annotatef(err, "bad charm URL in response")
	}
	return curl, nil
}
func ( c * Client ) UploadCharm ( curl * charm . URL , content io . ReadSeeker ) ( * charm . URL , error ) { args := url . Values { } args . Add ( " " , curl . Series ) args . Add ( " " , curl . Schema ) args . Add ( " " , strconv . Itoa ( curl . Revision ) ) apiURI := url . URL { Path : " " , RawQuery : args . Encode ( ) } contentType := " " var resp params . CharmsResponse if err := c . httpPost ( content , apiURI . String ( ) , contentType , & resp ) ; err != nil { return nil , errors . Trace ( err ) } curl , err := charm . ParseURL ( resp . CharmURL ) if err != nil { return nil , errors . Annotatef ( err , " " ) } return curl , nil }
UploadCharm sends the content to the API server using an HTTP post.
UploadCharm sends the content to the API server using an HTTP post .