1
0
mirror of https://github.com/badkaktus/gorocket.git synced 2024-12-12 11:15:05 +02:00

hooks edit

This commit is contained in:
kolyuchy 2020-05-06 09:43:20 +03:00
parent 47db6f4782
commit a2ab7a7b8c

View File

@ -28,10 +28,14 @@ type HookResponse struct {
func (c *Client) Hooks(msg *HookMessage, token string) (*HookResponse, error) {
opt, _ := json.Marshal(msg)
url := fmt.Sprintf("%s/hooks/%s", c.baseURL, token)
req, err := http.NewRequest("POST",
fmt.Sprintf("%s/hooks/%s", c.baseURL, token),
url,
bytes.NewBuffer(opt))
fmt.Println(url)
req.Header.Set("Accept", "application/json; charset=utf-8")
req.Header.Set("Content-Type", "application/json; charset=utf-8")
@ -40,9 +44,6 @@ func (c *Client) Hooks(msg *HookMessage, token string) (*HookResponse, error) {
}
res, err := c.HTTPClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer res.Body.Close()