You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
594 B

package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func sendMessage(b io.Reader, cloudID, conversationID string, token string) {
u := fmt.Sprintf("https://api.atlassian.com/site/%s/conversation/%s/message", cloudID, conversationID)
client := http.Client{}
req, err := http.NewRequest("POST", u, b)
if err != nil {
log.Println(err)
return
}
req.Header.Add("Authorization", "Bearer "+token)
req.Header.Add("Content-Type", "text/plain")
res, err := client.Do(req)
if err != nil {
log.Println(err)
return
}
defer res.Body.Close()
io.Copy(os.Stderr, res.Body)
}