Home / Class/ HttpPostRequestEncoder Class — netty Architecture

HttpPostRequestEncoder Class — netty Architecture

Architecture documentation for the HttpPostRequestEncoder class in HttpPostRequestEncoder.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1f646438_907e_54fe_bc9e_a9535d782cc8["HttpPostRequestEncoder"]
  4106fd73_2096_c5a3_d8ea_cf6f70536da1["HttpPostRequestEncoder.java"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|defined in| 4106fd73_2096_c5a3_d8ea_cf6f70536da1
  ab7ceb84_c061_5148_6a77_ed816f53fb90["HttpPostRequestEncoder()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| ab7ceb84_c061_5148_6a77_ed816f53fb90
  9b769d7a_da1a_a5f1_fb44_5ba495ace746["cleanFiles()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 9b769d7a_da1a_a5f1_fb44_5ba495ace746
  d72a46ba_bb3a_6921_6c78_69dc6b58de7a["isMultipart()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| d72a46ba_bb3a_6921_6c78_69dc6b58de7a
  568e4841_bf62_397c_8b79_c6e5f927d4ed["initDataMultipart()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 568e4841_bf62_397c_8b79_c6e5f927d4ed
  0924a77c_a48d_a433_faa9_50e64aacac26["initMixedMultipart()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 0924a77c_a48d_a433_faa9_50e64aacac26
  fa2ee9e9_9d8f_103d_f99c_914f466817d8["String()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| fa2ee9e9_9d8f_103d_f99c_914f466817d8
  eb6eb5b6_9f41_1446_2895_a8eebb3aaeb0["getBodyListAttributes()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| eb6eb5b6_9f41_1446_2895_a8eebb3aaeb0
  825155a3_ea32_cba2_570b_d7d81a99be81["setBodyHttpDatas()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 825155a3_ea32_cba2_570b_d7d81a99be81
  4e38b4d7_dd27_b7ac_b26d_b3f5cb2dd3bb["addBodyAttribute()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 4e38b4d7_dd27_b7ac_b26d_b3f5cb2dd3bb
  d1902978_08b3_e45f_2ca3_35c26719bf40["addBodyFileUpload()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| d1902978_08b3_e45f_2ca3_35c26719bf40
  533455ca_e5c7_8916_f00e_f6157942f82a["addBodyFileUploads()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 533455ca_e5c7_8916_f00e_f6157942f82a
  ca6541f6_10eb_06dc_c20a_7a3aee11d69a["addBodyHttpData()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| ca6541f6_10eb_06dc_c20a_7a3aee11d69a
  759866ff_a8ab_daf9_32b8_f22d083766c6["HttpRequest()"]
  1f646438_907e_54fe_bc9e_a9535d782cc8 -->|method| 759866ff_a8ab_daf9_32b8_f22d083766c6

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java lines 65–1335

public class HttpPostRequestEncoder implements ChunkedInput<HttpContent> {

    /**
     * Different modes to use to encode form data.
     */
    public enum EncoderMode {
        /**
         * Legacy mode which should work for most. It is known to not work with OAUTH. For OAUTH use
         * {@link EncoderMode#RFC3986}. The W3C form recommendations this for submitting post form data.
         */
        RFC1738,

        /**
         * Mode which is more new and is used for OAUTH
         */
        RFC3986,

        /**
         * The HTML5 spec disallows mixed mode in multipart/form-data
         * requests. More concretely this means that more files submitted
         * under the same name will not be encoded using mixed mode, but
         * will be treated as distinct fields.
         *
         * Reference:
         *   https://www.w3.org/TR/html5/forms.html#multipart-form-data
         */
        HTML5
    }

    private static final String ASTERISK = "*";
    private static final String PLUS = "+";
    private static final String TILDE = "~";
    private static final String ASTERISK_REPLACEMENT = "%2A";
    private static final String PLUS_REPLACEMENT = "%20";
    private static final String TILDE_REPLACEMENT = "%7E";

    /**
     * Factory used to create InterfaceHttpData
     */
    private final HttpDataFactory factory;

    /**
     * Request to encode
     */
    private final HttpRequest request;

    /**
     * Default charset to use
     */
    private final Charset charset;

    /**
     * Chunked false by default
     */
    private boolean isChunked;

    /**
     * InterfaceHttpData for Body (without encoding)
     */
    private final List<InterfaceHttpData> bodyListDatas;
    /**
     * The final Multipart List of InterfaceHttpData including encoding
     */
    final List<InterfaceHttpData> multipartHttpDatas;

    /**
     * Does this request is a Multipart request
     */
    private final boolean isMultipart;

    /**
     * If multipart, this is the boundary for the flobal multipart
     */
    String multipartDataBoundary;

    /**
     * If multipart, there could be internal multiparts (mixed) to the global multipart. Only one level is allowed.
     */
    String multipartMixedBoundary;
    /**
     * To check if the header has been finalized

Frequently Asked Questions

What is the HttpPostRequestEncoder class?
HttpPostRequestEncoder is a class in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java.
Where is HttpPostRequestEncoder defined?
HttpPostRequestEncoder is defined in codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostRequestEncoder.java at line 65.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free