Open Fabio3rs opened 1 year ago
Hi, I am not a contributor of Pistache, but I can provide the following feedback.
getData
, tryGetData
and getDataAs
: I would personally condense these functions into one single function returning a std::optional
. The optional should be parametrized with the type of data I want it to hold (just like what getDataAs
currently does).setData
instead of putData
: as a user, knowing that there is a get
function, I would look for a set
corresponding one rather than a put
one.removeData
should throw an error if the key does not exist.setAttribute
and getAttribute
are intuitive to me, whereas I would have more trouble understanding the intent of setData
and getData
(what does "data" refer to? is it perhaps the HTTP body?).Hi. Thank you! I think your observations are good, I was trying to make similar to the Pistache::Tcp::Peer code https://github.com/pistacheio/pistache/blob/master/include/pistache/peer.h#L54
I am not sure how to proceed is this case.
The issue #1080 has some time and I didn't saw pull requests, I think this is very useful, so I make some code that do it.
I created two commits:
Suggestions for more tests? Or names? Thanks!