@Override
            public HttpMessageParser<ClassicHttpResponse> create() {
                final LineParser lineParser = new BasicLineParser() {

                    @Override
                    public Header parseHeader(final CharArrayBuffer buffer) {
                        try {
                            return super.parseHeader(buffer);
                        } catch (final ParseException ex) {
                            return new BasicHeader(buffer.toString(), null);
                        }
                    }

                };
                return new DefaultHttpResponseParser(h1Config, lineParser, DefaultClassicHttpResponseFactory.INSTANCE);
            }
This example demonstrates how to customize and configure the most common aspects
of HTTP request execution and connection management.
httpclient5/src/test/java/org/apache/hc/client5/http/examples/ClientConfiguration.java