HTTPGetString performs a GET request and returns the response as a string. Only hostnames configured in the policy engine's AllowedHosts are accessible.
(url string)
| 54 | // HTTPGetString performs a GET request and returns the response as a string. |
| 55 | // Only hostnames configured in the policy engine's AllowedHosts are accessible. |
| 56 | func HTTPGetString(url string) (string, error) { |
| 57 | body, err := HTTPGet(url) |
| 58 | if err != nil { |
| 59 | return "", err |
| 60 | } |
| 61 | return string(body), nil |
| 62 | } |