service/lease.go
func (s *Lease) InitFromHTTPRequest(req *http.Request) (err error) {

	if req.Body != nil {

		if body, err := ioutil.ReadAll(req.Body); err == nil {

			if err = json.Unmarshal(body, s); err != nil {
				GLogger.Println(err)
			}
		}
	} else {
		err = ErrEmptyBody
	}

	if s.ProcurementMeta == nil {
		s.ProcurementMeta = make(map[string]interface{})
	}
	return
}
func (s *Lease) InitFromHTTPRequest(req *http.Request) (err error) {

	if req.Body != nil {

		if body, err := ioutil.ReadAll(req.Body); err == nil {

			if err = json.Unmarshal(body, s); err != nil {
				GLogger.Println(err)
			}
		}
	} else {
		err = ErrEmptyBody
	}

	if s.ProcurementMeta == nil {
		s.ProcurementMeta = make(map[string]interface{})
	}
	return
}
//InitFromHTTPRequest - initialize a lease from the http request object body