Code example for HttpURLConnection

Methods: usingProxy

0
        connection.disconnect();
        connected = false;
    } 
 
    public boolean usingProxy() { 
        return connection.usingProxy();
    } 
 
    public InputStream getErrorStream() {
        return connection.getErrorStream();
    } 
 
    private int parseResponseCode() throws IOException { 
        try { 
            String response = connection.getHeaderField(0);
            int index = response.indexOf(' ');
            while (response.charAt(index) == ' ') index++;
            return Integer.parseInt(response.substring(index, index + 3));
        } catch (Exception ex) {
            throw new IOException(ex.getMessage());
Connect your IDE to all the code out there  Get Codota for Java