authelia/internal/suites/action_http.go
Amir Zarrinkafsh 1600e0f7da
[CI] Add wsl linter (#980)
* [CI] Add wsl linter

* Implement wsl recommendations

Co-authored-by: Clément Michaud <clement.michaud34@gmail.com>
2020-05-05 21:35:32 +02:00

25 lines
435 B
Go

package suites
import (
"io/ioutil"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func doHTTPGetQuery(t *testing.T, url string) []byte {
client := NewHTTPClient()
req, err := http.NewRequest("GET", url, nil)
assert.NoError(t, err)
req.Header.Add("Accept", "application/json")
resp, err := client.Do(req)
assert.NoError(t, err)
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
return body
}