mirror of
1
Fork 0

Don't hardcode method in NewRequest function

This commit is contained in:
erik 2023-11-28 10:55:18 +01:00 committed by Michael Jerger
parent 8a53331283
commit 56d11bbff4
1 changed files with 2 additions and 2 deletions

View File

@ -97,9 +97,9 @@ func NewClient(ctx context.Context, user *user_model.User, pubID string) (c *Cli
}
// NewRequest function
func (c *Client) NewRequest(b []byte, to string) (req *http.Request, err error) {
func (c *Client) NewRequest(method string, b []byte, to string) (req *http.Request, err error) {
buf := bytes.NewBuffer(b)
req, err = http.NewRequest(http.MethodPost, to, buf)
req, err = http.NewRequest(method, to, buf)
if err != nil {
return nil, err
}