pdclient/dispenser_client.go
func (s *PDClient) PostLease(leaseID, inventoryID, skuID, userName string, leaseDaysDuration int64) (leaseCreateResponse TaskResponse, res *http.Response, err error) {
	var body io.Reader
	if body, err = s.getRequestBody(leaseID, inventoryID, skuID, userName, leaseDaysDuration, make(map[string]interface{}, 1)); err == nil {
		req, _ := s.createRequest("POST", fmt.Sprintf("%s/v1/lease", s.URL), body)

		if res, err = s.client.Do(req); err == nil && res.StatusCode == http.StatusCreated {
			resBodyBytes, _ := ioutil.ReadAll(res.Body)
			json.Unmarshal(resBodyBytes, &leaseCreateResponse)

		} else {
			lo.G.Error("client Do Error: ", err)
			lo.G.Error("client Res: ", res)
			err = ErrInvalidDispenserResponse
		}

	} else {
		lo.G.Error("request body error: ", err.Error())
	}
	return
}
func (s *PDClient) PostLease(leaseID, inventoryID, skuID, userName string, leaseDaysDuration int64) (leaseCreateResponse TaskResponse, res *http.Response, err error) {
	var body io.Reader
	if body, err = s.getRequestBody(leaseID, inventoryID, skuID, userName, leaseDaysDuration, make(map[string]interface{}, 1)); err == nil {
		req, _ := s.createRequest("POST", fmt.Sprintf("%s/v1/lease", s.URL), body)

		if res, err = s.client.Do(req); err == nil && res.StatusCode == http.StatusCreated {
			resBodyBytes, _ := ioutil.ReadAll(res.Body)
			json.Unmarshal(resBodyBytes, &leaseCreateResponse)

		} else {
			lo.G.Error("client Do Error: ", err)
			lo.G.Error("client Res: ", res)
			err = ErrInvalidDispenserResponse
		}

	} else {
		lo.G.Error("request body error: ", err.Error())
	}
	return
}
//PostLease -- allows a client user to post a lease to dispenser