// Create makes a POST request containing a multipart/form-data body with the
// contents of a content item to be created and stored in Ponzu. Note: the fileKeys
// []string argument should contain the field/key names of the item's uploads.
//
// The *APIResponse will indicate whether the request failed or succeeded based
// on the contents of its Data or JSON fields, or by checking the Status of it's
// original http.Response. Callers should expect failures to occur when a Content
// type does not implement the api.Createable interface
Create makes a POST request containing a multipart/form-data body with the
contents of a content item to be created and stored in Ponzu. Note: the fileKeys
[]string argument should contain the field/key names of the item's uploads.

The *APIResponse will indicate whether the request failed or succeeded based
on the contents of its Data or JSON fields, or by checking the Status of it's
original http.Response. Callers should expect failures to occur when a Content
type does not implement the api.Createable interface
// Create makes a POST request containing a multipart / form - data body with the // contents of a content item to be created and stored in Ponzu . Note : the fileKeys // [] string argument should contain the field / key names of the item ' s uploads . // // The * APIResponse will indicate whether the request failed or succeeded based // on the contents of its Data or JSON fields or by checking the Status of it ' s // original http . Response . Callers should expect failures to occur when a Content // type does not implement the api . Createable interface
func (c *Client) Create(contentType string, data *Values, fileKeys []string) (*APIResponse, error) {
	endpoint := fmt.Sprintf(
		"%s/api/content/create?type=%s",
		c.Conf.Host, contentType,
	)
	req, err := multipartForm(endpoint, data, fileKeys)
	if err != nil {
		return nil, err
	}
	req = mergeHeader(req, c.Conf.Header)
	w, err := c.Do(req)
	if err != nil {
		return nil, err
	}
	resp := &APIResponse{
		Response: w,
	}
	err = resp.process()
	if err != nil {
		return nil, err
	}
	return resp, nil
}
func ( c * Client ) Create ( contentType string , data * Values , fileKeys [ ] string ) ( * APIResponse , error ) { endpoint := fmt . Sprintf ( " " , c . Conf . Host , contentType , ) req , err := multipartForm ( endpoint , data , fileKeys ) if err != nil { return nil , err } req = mergeHeader ( req , c . Conf . Header ) w , err := c . Do ( req ) if err != nil { return nil , err } resp := & APIResponse { Response : w , } err = resp . process ( ) if err != nil { return nil , err } return resp , nil }
Create makes a POST request containing a multipart/form-data body with the
contents of a content item to be created and stored in Ponzu.
Create makes a POST request containing a multipart / form - data body with the contents of a content item to be created and stored in Ponzu .