...
url := "https://<removed_from_example>.convex.site/api/action"
body := map[string]interface{}{
"path": "items:testHttpActions",
"args": "",
"format": "json",
}
jsonBody, err := json.Marshal(body)
if err != nil {
return err
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody))
if err != nil {
return err
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", CONVEX_API_KEY))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
...
...
url := "https://<removed_from_example>.convex.site/api/action"
body := map[string]interface{}{
"path": "items:testHttpActions",
"args": "",
"format": "json",
}
jsonBody, err := json.Marshal(body)
if err != nil {
return err
}
req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody))
if err != nil {
return err
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", CONVEX_API_KEY))
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
...