Add method to create request with form data

Signed-off-by: Vartan Benohanian <vartanbeno@gmail.com>
This commit is contained in:
Vartan Benohanian
2020-07-11 14:11:41 -04:00
parent 4094044593
commit 8f95f3880a
10 changed files with 40 additions and 41 deletions
+2 -2
View File
@@ -397,7 +397,7 @@ func (s *AccountService) AddTrusted(ctx context.Context, username string) (*Resp
form.Set("name", username)
// todo: you can also do this with the user id. form.Set("id", id). should we? or is this enough?
req, err := s.client.NewPostForm(path, form)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}
@@ -414,7 +414,7 @@ func (s *AccountService) RemoveTrusted(ctx context.Context, username string) (*R
form.Set("name", username)
// todo: you can also do this with the user id. form.Set("id", id). should we? or is this enough?
req, err := s.client.NewPostForm(path, form)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}