Add documentation and example for serving binary data from memory#369
Merged
Add documentation and example for serving binary data from memory#369
Conversation
The existing string_response already supports binary content (std::string can hold arbitrary bytes), but this was not documented or demonstrated anywhere. This gap caused users to believe a new response type was needed (see PR #368). - Add a note to the README's string_response description clarifying binary data support - Add a new "Serving binary data from memory" section with inline example - Add examples/binary_buffer_response.cpp as a complete, buildable example that serves a PNG image from an in-memory buffer - Register the new example in examples/Makefile.am https://claude.ai/code/session_01S3BvBrSoNvUhpYTyhPYCjJ
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #369 +/- ##
=======================================
Coverage 67.97% 67.97%
=======================================
Files 28 28
Lines 1636 1636
Branches 672 672
=======================================
Hits 1112 1112
Misses 64 64
Partials 460 460 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Add ChangeLog entry for the binary buffer example to satisfy the ChangeLog Check workflow. Add missing #include <utility> for std::move to fix cpplint warning. https://claude.ai/code/session_01S3BvBrSoNvUhpYTyhPYCjJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing string_response already supports binary content (std::string
can hold arbitrary bytes), but this was not documented or demonstrated
anywhere. This gap caused users to believe a new response type was needed
(see PR #368).
binary data support
that serves a PNG image from an in-memory buffer
https://claude.ai/code/session_01S3BvBrSoNvUhpYTyhPYCjJ