Can't open an url with loadJSONObject but it works with HTTP Library

This is what I did, I just used a Collector to deal with the BufferedReader’s output.

import java.util.stream.Collectors;

BufferedReader ir = new BufferedReader(new InputStreamReader((InputStream) connection.getContent()));
return parseJSONArray(ir.lines().collect(Collectors.joining()));
1 Like