etr / libhttpserver

C++ library for creating an embedded Rest HTTP server (and more)
GNU Lesser General Public License v2.1
882 stars 184 forks source link

Added a get-method for the content of a string_response #320

Open hsiegmund opened 1 year ago

hsiegmund commented 1 year ago

Description of the Change

Added a getter for the content of a string_response. Example usage: a custom logger that shall log the content.

Release Notes

Added a get-method for the content of a string_response.

etr commented 1 year ago

I am not against having a get_content (or something of the likes) as part of the http_response, possibly to benefit logging. In the current approach though, this covers only string_response and I am not sure why this variant of the http_response should have different treatment from the rest.

I would propose we build something that can be reuse across all types of responses.