Skip to content

Commit

Permalink
remove unnecessary code
Browse files Browse the repository at this point in the history
Signed-off-by: MiriSafra <m0533175827@gmail.com>
  • Loading branch information
MiriSafra committed Oct 27, 2024
1 parent 0479e22 commit 1ce42ce
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions binding/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,50 +142,6 @@ func (r *Client) Get(path string, object any, params ...Param) (err error) {
return
}

// Post a resource.
// func (r *Client) Post(path string, object any) (err error) {
// request := func() (request *http.Request, err error) {
// bfr, err := json.Marshal(object)
// if err != nil {
// err = liberr.Wrap(err)
// return
// }
// reader := bytes.NewReader(bfr)
// request = &http.Request{
// Header: http.Header{},
// Method: http.MethodPost,
// Body: io.NopCloser(reader),
// URL: r.join(path),
// }
// request.Header.Set(api.Accept, binding.MIMEJSON)
// return
// }
// response, err := r.send(request)
// if err != nil {
// return
// }
// status := response.StatusCode
// switch status {
// case http.StatusAccepted:
// case http.StatusNoContent:
// case http.StatusOK,
// http.StatusCreated:
// var body []byte
// body, err = io.ReadAll(response.Body)
// if err != nil {
// err = liberr.Wrap(err)
// return
// }
// err = json.Unmarshal(body, object)
// if err != nil {
// err = liberr.Wrap(err)
// return
// }
// default:
// err = r.restError(response)
// }
// return
// }

// Post a resource.
func (r *Client) Post(path string, object any, returnValue ...any) (err error) {
Expand Down

0 comments on commit 1ce42ce

Please sign in to comment.