88 "bytes"
99 "encoding/json"
1010 "fmt"
11- "net/http"
1211 "time"
1312)
1413
@@ -62,8 +61,7 @@ func (c *Client) CreateRepo(opt CreateRepoOption) (*Repository, error) {
6261 return nil , err
6362 }
6463 repo := new (Repository )
65- return repo , c .getParsedResponse ("POST" , "/user/repos" ,
66- http.Header {"content-type" : []string {"application/json" }}, bytes .NewReader (body ), repo )
64+ return repo , c .getParsedResponse ("POST" , "/user/repos" , jsonHeader , bytes .NewReader (body ), repo )
6765}
6866
6967// CreateOrgRepo creates an organization repository for authenticated user.
@@ -73,8 +71,7 @@ func (c *Client) CreateOrgRepo(org string, opt CreateRepoOption) (*Repository, e
7371 return nil , err
7472 }
7573 repo := new (Repository )
76- return repo , c .getParsedResponse ("POST" , fmt .Sprintf ("/org/%s/repos" , org ),
77- http.Header {"content-type" : []string {"application/json" }}, bytes .NewReader (body ), repo )
74+ return repo , c .getParsedResponse ("POST" , fmt .Sprintf ("/org/%s/repos" , org ), jsonHeader , bytes .NewReader (body ), repo )
7875}
7976
8077// GetRepo returns information of a repository of given owner.
@@ -111,6 +108,5 @@ func (c *Client) MigrateRepo(opt MigrateRepoOption) (*Repository, error) {
111108 return nil , err
112109 }
113110 repo := new (Repository )
114- return repo , c .getParsedResponse ("POST" , "/repos/migrate" ,
115- http.Header {"content-type" : []string {"application/json" }}, bytes .NewReader (body ), repo )
111+ return repo , c .getParsedResponse ("POST" , "/repos/migrate" , jsonHeader , bytes .NewReader (body ), repo )
116112}
0 commit comments