I am trying this in Android Studio, but the line
connection.addRequestProperty("Authorization", basicAuth)