org.apache.hc.client5.http.impl.io

## Class LenientHttpResponseParser

- java.lang.Object
- - org.apache.hc.core5.http.impl.io.AbstractMessageParser<ClassicHttpResponse>
  - - org.apache.hc.core5.http.impl.io.DefaultHttpResponseParser
    - - org.apache.hc.client5.http.impl.io.LenientHttpResponseParser

- All Implemented Interfaces:
    HttpMessageParser<ClassicHttpResponse>

      public class LenientHttpResponseParser
      extends DefaultHttpResponseParser

  Lenient HTTP response parser implementation that can skip malformed data until a valid HTTP response message head is encountered.
  Since:
    4.2

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `LenientHttpResponseParser(Http1Config h1Config)` Creates new instance of DefaultHttpResponseParser.
    `LenientHttpResponseParser(LineParser lineParser, HttpResponseFactory<ClassicHttpResponse> responseFactory, Http1Config h1Config)` Creates new instance of DefaultHttpResponseParser.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected ClassicHttpResponse` | `createMessage(CharArrayBuffer buffer)`

    - ### Methods inherited from class org.apache.hc.core5.http.impl.io.AbstractMessageParser

      `createConnectionClosedException, parse, parseHeaders, parseHeaders`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### LenientHttpResponseParser

          public LenientHttpResponseParser(LineParser lineParser,
                                           HttpResponseFactory<ClassicHttpResponse> responseFactory,
                                           Http1Config h1Config)

      Creates new instance of DefaultHttpResponseParser.
      Parameters:
        `lineParser` - the line parser. If `null` `BasicLineParser.INSTANCE` will be used.
        `responseFactory` - HTTP response factory. If `null` `DefaultClassicHttpResponseFactory.INSTANCE` will be used.
        `h1Config` - HTTP/1.1 parameters. If `null`. `Http1Config.DEFAULT` will be used.
      Since:
        4.3

    - #### LenientHttpResponseParser

          public LenientHttpResponseParser(Http1Config h1Config)

      Creates new instance of DefaultHttpResponseParser.
      Parameters:
        `h1Config` - HTTP/1.1 parameters. If `null`. `Http1Config.DEFAULT` will be used.
      Since:
        4.3

  - ### Method Detail

    - #### createMessage

          protected ClassicHttpResponse createMessage(CharArrayBuffer buffer)
                                               throws IOException

      Overrides:
        `createMessage` in class `DefaultHttpResponseParser`
      Throws:
        `IOException`

Copyright © 1999–2021 The Apache Software Foundation. All rights reserved.