Class LenientHttpResponseParser

java.lang.Object
org.apache.hc.core5.http.impl.io.AbstractMessageParser<org.apache.hc.core5.http.ClassicHttpResponse>
org.apache.hc.core5.http.impl.io.DefaultHttpResponseParser
org.apache.hc.client5.http.impl.io.LenientHttpResponseParser
All Implemented Interfaces:
org.apache.hc.core5.http.io.HttpMessageParser<org.apache.hc.core5.http.ClassicHttpResponse>

public class LenientHttpResponseParser extends org.apache.hc.core5.http.impl.io.DefaultHttpResponseParser
Lenient HTTP response parser implementation that can skip malformed data until a valid HTTP response message head is encountered.
Since:
4.2
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final org.slf4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LenientHttpResponseParser(org.apache.hc.core5.http.config.Http1Config h1Config)
    Creates new instance of DefaultHttpResponseParser.
    LenientHttpResponseParser(org.apache.hc.core5.http.message.LineParser lineParser, org.apache.hc.core5.http.HttpResponseFactory<org.apache.hc.core5.http.ClassicHttpResponse> responseFactory, org.apache.hc.core5.http.config.Http1Config h1Config)
    Creates new instance of DefaultHttpResponseParser.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.apache.hc.core5.http.ClassicHttpResponse
    createMessage(org.apache.hc.core5.util.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
  • Field Details

    • LOG

      private static final org.slf4j.Logger LOG
  • Constructor Details

    • LenientHttpResponseParser

      public LenientHttpResponseParser(org.apache.hc.core5.http.message.LineParser lineParser, org.apache.hc.core5.http.HttpResponseFactory<org.apache.hc.core5.http.ClassicHttpResponse> responseFactory, org.apache.hc.core5.http.config.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(org.apache.hc.core5.http.config.Http1Config h1Config)
      Creates new instance of DefaultHttpResponseParser.
      Parameters:
      h1Config - HTTP/1.1 parameters. If null. Http1Config.DEFAULT will be used.
      Since:
      4.3
  • Method Details

    • createMessage

      protected org.apache.hc.core5.http.ClassicHttpResponse createMessage(org.apache.hc.core5.util.CharArrayBuffer buffer) throws IOException
      Overrides:
      createMessage in class org.apache.hc.core5.http.impl.io.DefaultHttpResponseParser
      Throws:
      IOException