/** * Create a configured instance of {@link RawHttp}. * * @param options configuration options */ public RawHttp(RawHttpOptions options) { this.options = options; this.metadataParser = new HttpMetadataParser(options); }
/** * Create a configured instance of {@link RawHttp}. * * @param options configuration options */ public RawHttp(RawHttpOptions options) { this.options = options; this.metadataParser = new HttpMetadataParser(options); }
/** * @return a strict HTTP metadata parser (uses {@link RawHttpOptions#strict()}. */ public static HttpMetadataParser createStrictHttpMetadataParser() { return new HttpMetadataParser(RawHttpOptions.strict()); }
/** * @return a strict HTTP metadata parser (uses {@link RawHttpOptions#strict()}. */ public static HttpMetadataParser createStrictHttpMetadataParser() { return new HttpMetadataParser(RawHttpOptions.strict()); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * * @param stream content to encode * @param contentType Content-Type of the stream contents * @param chunkLength the length of each chunk */ public ChunkedBody(InputStream stream, @Nullable String contentType, int chunkLength) { this(stream, contentType, chunkLength, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * * @param stream content to encode * @param contentType Content-Type of the stream contents * @param chunkLength the length of each chunk */ public ChunkedBody(InputStream stream, @Nullable String contentType, int chunkLength) { this(stream, contentType, chunkLength, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * <p> * A default chunk size of 4096 bytes is used. * * @param stream content to encode */ public ChunkedBody(InputStream stream) { this(stream, null, 4096, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }
/** * Create a new {@link ChunkedBody} to encode the contents of the given stream. * <p> * The stream is read lazily, so it shouldn't be closed until this body is consumed. * <p> * A default chunk size of 4096 bytes is used. * * @param stream content to encode */ public ChunkedBody(InputStream stream) { this(stream, null, 4096, defaultChunkedBodyDecoder(), new HttpMetadataParser(RawHttpOptions.defaultInstance())); }