// ContentBySlug makes a GET request to return the Ponzu Content API response for the
// enpoint: `/api/content?slug=<Slug>`
ContentBySlug makes a GET request to return the Ponzu Content API response for the
enpoint: `/api/content?slug=`
// ContentBySlug makes a GET request to return the Ponzu Content API response for the // enpoint : ` / api / content?slug = <Slug > `
func (c *Client) ContentBySlug(slug string) (*APIResponse, error) {
	endpoint := fmt.Sprintf(
		"%s/api/content?slug=%s",
		c.Conf.Host, slug,
	)
	if c.CacheEnabled() {
		ok, resp := c.Cache.Check(endpoint)
		if ok {
			return resp, nil
		}
	}
	req, err := http.NewRequest(http.MethodGet, endpoint, nil)
	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 resp, err
	}
	if c.CacheEnabled() {
		err := c.Cache.Add(endpoint, resp)
		return resp, err
	}
	return resp, nil
}
func ( c * Client ) ContentBySlug ( slug string ) ( * APIResponse , error ) { endpoint := fmt . Sprintf ( " " , c . Conf . Host , slug , ) if c . CacheEnabled ( ) { ok , resp := c . Cache . Check ( endpoint ) if ok { return resp , nil } } req , err := http . NewRequest ( http . MethodGet , endpoint , nil ) 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 resp , err } if c . CacheEnabled ( ) { err := c . Cache . Add ( endpoint , resp ) return resp , err } return resp , nil }
ContentBySlug makes a GET request to return the Ponzu Content API response for the
enpoint: `/api/content?slug=`
ContentBySlug makes a GET request to return the Ponzu Content API response for the enpoint : ` / api / content?slug = `