bambou/session.go
func (s *Session) FetchChildren(parent Identifiable, identity Identity, dest interface{}, info *FetchingInfo) *Error {

	url, berr := s.getURLForChildrenIdentity(parent, identity)
	if berr != nil {
		return berr
	}

	request, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return NewBambouError("HTTP transaction error", err.Error())
	}

	response, berr := s.send(request, info)
	if berr != nil {
		return berr
	}
	defer response.Body.Close()

	body, _ := ioutil.ReadAll(response.Body)
	log.Debugf("Response Body: %s", string(body))

	if response.StatusCode == http.StatusNoContent || response.ContentLength == 0 {
		return nil
	}

	if err := json.Unmarshal(body, &dest); err != nil {
		return NewBambouError("HTTP Unmarshaling error", err.Error())
	}

	return nil
}
func (s *Session) FetchChildren(parent Identifiable, identity Identity, dest interface{}, info *FetchingInfo) *Error {

	url, berr := s.getURLForChildrenIdentity(parent, identity)
	if berr != nil {
		return berr
	}

	request, err := http.NewRequest("GET", url, nil)
	if err != nil {
		return NewBambouError("HTTP transaction error", err.Error())
	}

	response, berr := s.send(request, info)
	if berr != nil {
		return berr
	}
	defer response.Body.Close()

	body, _ := ioutil.ReadAll(response.Body)
	log.Debugf("Response Body: %s", string(body))

	if response.StatusCode == http.StatusNoContent || response.ContentLength == 0 {
		return nil
	}

	if err := json.Unmarshal(body, &dest); err != nil {
		return NewBambouError("HTTP Unmarshaling error", err.Error())
	}

	return nil
}
func ( s * Session ) FetchChildren ( parent Identifiable , identity Identity , dest interface { } , info * FetchingInfo ) * Error { url , berr := s . getURLForChildrenIdentity ( parent , identity ) if berr != nil { return berr } request , err := http . NewRequest ( " " , url , nil ) if err != nil { return NewBambouError ( " " , err . Error ( ) ) } response , berr := s . send ( request , info ) if berr != nil { return berr } defer response . Body . Close ( ) body , _ := ioutil . ReadAll ( response . Body ) log . Debugf ( " " , string ( body ) ) if response . StatusCode == http . StatusNoContent || response . ContentLength == 0 { return nil } if err := json . Unmarshal ( body , & dest ) ; err != nil { return NewBambouError ( " " , err . Error ( ) ) } return nil }
// FetchChildren fetches the children with of given parent identified by the given Identity.
FetchChildren fetches the children with of given parent identified by the given Identity .