Home / Function/ testDecodeFullHttpRequestWithUrlEncodedBody() — netty Function Reference

testDecodeFullHttpRequestWithUrlEncodedBody() — netty Function Reference

Architecture documentation for the testDecodeFullHttpRequestWithUrlEncodedBody() function in HttpPostRequestDecoderTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  5f288488_7554_99d7_6360_8edd578b2f79["testDecodeFullHttpRequestWithUrlEncodedBody()"]
  d3dadcbe_07b1_86dc_3f34_5a56e9d1367e["HttpPostRequestDecoderTest"]
  5f288488_7554_99d7_6360_8edd578b2f79 -->|defined in| d3dadcbe_07b1_86dc_3f34_5a56e9d1367e
  style 5f288488_7554_99d7_6360_8edd578b2f79 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java lines 863–893

    @Test
    public void testDecodeFullHttpRequestWithUrlEncodedBody() throws Exception {
        byte[] bodyBytes = "foo=bar&a=b&empty=&city=%3c%22new%22%20york%20city%3e&other_city=los+angeles".getBytes();
        ByteBuf content = Unpooled.directBuffer(bodyBytes.length);
        content.writeBytes(bodyBytes);

        FullHttpRequest req = new DefaultFullHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/", content);
        HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(req);
        assertFalse(decoder.getBodyHttpDatas().isEmpty());

        assertFalse(decoder.getBodyHttpDatas().isEmpty());
        assertEquals(5, decoder.getBodyHttpDatas().size());

        Attribute attr = (Attribute) decoder.getBodyHttpData("foo");
        assertEquals("bar", attr.getValue());

        attr = (Attribute) decoder.getBodyHttpData("a");
        assertEquals("b", attr.getValue());

        attr = (Attribute) decoder.getBodyHttpData("empty");
        assertEquals("", attr.getValue());

        attr = (Attribute) decoder.getBodyHttpData("city");
        assertEquals("<\"new\" york city>", attr.getValue());

        attr = (Attribute) decoder.getBodyHttpData("other_city");
        assertEquals("los angeles", attr.getValue());

        decoder.destroy();
        assertTrue(req.release());
    }

Domain

Subdomains

Frequently Asked Questions

What does testDecodeFullHttpRequestWithUrlEncodedBody() do?
testDecodeFullHttpRequestWithUrlEncodedBody() is a function in the netty codebase, defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java.
Where is testDecodeFullHttpRequestWithUrlEncodedBody() defined?
testDecodeFullHttpRequestWithUrlEncodedBody() is defined in codec-http/src/test/java/io/netty/handler/codec/http/multipart/HttpPostRequestDecoderTest.java at line 863.

Analyze Your Own Codebase

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

Try Supermodel Free