MCPcopy Create free account
hub / github.com/boostorg/beast / doExplicitChunkParse

Method doExplicitChunkParse

test/doc/http_examples.cpp:342–379  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

340 //--------------------------------------------------------------------------
341
342 void
343 doExplicitChunkParse()
344 {
345 test::stream ts(ioc_,
346 "HTTP/1.1 200 OK\r\n"
347 "Server: test\r\n"
348 "Trailer: Content-Digest\r\n"
349 "Transfer-Encoding: chunked\r\n"
350 "\r\n"
351 "5\r\n"
352 "First\r\n"
353 "d;quality=1.0\r\n"
354 "Hello, world!\r\n"
355 "e;file=abc.txt;quality=0.7\r\n"
356 "The Next Chunk\r\n"
357 "8;last\r\n"
358 "Last one\r\n"
359 "0\r\n"
360 "Content-Digest: f4a5c16584f03d90\r\n"
361 "\r\n");
362
363
364 error_code ec;
365 flat_buffer b;
366 std::stringstream ss;
367 print_chunked_body<false>(ss, ts, b, ec);
368 BEAST_EXPECTS(! ec, ec.message());
369 BEAST_EXPECT(ss.str() ==
370 "Chunk Body: First\n"
371 "Extension: quality = 1.0\n"
372 "Chunk Body: Hello, world!\n"
373 "Extension: file = abc.txt\n"
374 "Extension: quality = 0.7\n"
375 "Chunk Body: The Next Chunk\n"
376 "Extension: last\n"
377 "Chunk Body: Last one\n"
378 "Content-Digest: f4a5c16584f03d90\n");
379 }
380
381 //--------------------------------------------------------------------------
382

Callers

nothing calls this directly

Calls 2

messageMethod · 0.80
strMethod · 0.45

Tested by

no test coverage detected