I send GET request and receive error 500
def baseUrl = new URL(url)
HttpURLConnection connection = (HttpURLConnection) baseUrl.openConnection();
connection.addRequestProperty("Authorization", "user1 user1")
connection.addRequestProperty("Accept", "application/json")
connection.with {
doOutput = true
requestMethod = 'GET'
println content.text
}
I am sure that my api work true.
How to pass your username and password in a get request with groovy?