import "github.com/brooklyncentral/brooklyn-cli/net" url := "https://example.com/api/v1/data" response, err := net.SendGetRequest(url) if err != nil { // handle error } // use response string
import "github.com/brooklyncentral/brooklyn-cli/net" url := "https://example.com/api/v1/data" headers := map[string]string{ "Authorization": "Bearer XXXXXXXXXXXXXXXXXXXX", "Content-Type": "application/json", } response, err := net.SendGetRequestWithHeaders(url, headers) if err != nil { // handle error } // use response stringIn both examples, the function `SendGetRequest()` is used to make a GET request to the given URL. In the second example, headers are added to the request by using the function `SendGetRequestWithHeaders()`. These examples demonstrate the use of the `SendGetRequest()` function in the `github.com/brooklyncentral/brooklyn-cli/net` package library.