Code example for NoHttpResponseException

0
            // clear the buffer 
            this.lineBuf.clear();
            final int i = sessionBuffer.readLine(this.lineBuf);
            if (i == -1 && count == 0) {
                // The server just dropped connection on us 
                throw new NoHttpResponseException("The target server failed to respond");
            } 
            cursor = new ParserCursor(0, this.lineBuf.length());
            if (lineParser.hasProtocolVersion(this.lineBuf, cursor)) {
                // Got one 
                break; 
            } else if (i == -1 || reject(this.lineBuf, count)) {
                // Giving up 
                throw new ProtocolException("The server failed to respond with a " +
                        "valid HTTP response"); 
            } 
            if (this.log.isDebugEnabled()) {
                this.log.debug("Garbage in response: " + this.lineBuf.toString());
            } 
            count++;
Contextual code suggestions in your IDE  Get Codota for Java