Template
1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo synced 2024-11-25 11:16:11 +01:00

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

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
}