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
@@ -400,7 +400,7 @@ func (s *UserService) Block(ctx context.Context, username string) (*Blocked, *Re
form := url.Values{}
form.Set("name", username)
req, err := s.client.NewPostForm(path, form)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, nil, err
}
@@ -449,7 +449,7 @@ func (s *UserService) Unblock(ctx context.Context, username string) (*Response,
form.Set("type", "enemy")
form.Set("container", selfID)
req, err := s.client.NewPostForm(path, form)
req, err := s.client.NewRequestWithForm(http.MethodPost, path, form)
if err != nil {
return nil, err
}