mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-27 04:43:59 +01:00
Don't hardcode method in NewRequest function
This commit is contained in:
parent
8a53331283
commit
56d11bbff4
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue