Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0d04678

Browse files
7byteunknwon
authored andcommitted
add jsonHeader to put request (#97)
1 parent c84e492 commit 0d04678

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

‎repo_collaborator.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollabo
2929
if err != nil {
3030
return err
3131
}
32-
_, err = c.getResponse("PUT", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), nil, bytes.NewReader(body))
32+
_, err = c.getResponse("PUT", fmt.Sprintf("/repos/%s/%s/collaborators/%s", user, repo, collaborator), jsonHeader, bytes.NewReader(body))
3333
return err
3434
}
3535

‎user_follow.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (c *Client) IsUserFollowing(user, target string) bool {
3737
}
3838

3939
func (c *Client) Follow(target string) error {
40-
_, err := c.getResponse("PUT", fmt.Sprintf("/user/following/%s", target), nil, nil)
40+
_, err := c.getResponse("PUT", fmt.Sprintf("/user/following/%s", target), jsonHeader, nil)
4141
return err
4242
}
4343

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /