Open
Description
Is your feature request related to a problem? Please describe.
The body parsers (at least the one for URL-encoded bodies) should provide a getFieldValue()
shortcut that returns the complete value of a field. That makes handling small forms easier.
Describe the solution you'd like
Instead of this code:
char buf[512];
size_t bufIdx = 0;
while (!parser.endOfField() || bufId >= 512) {
size_t readLength = parser.read(buf[bufIdx], 512);
bufIdx += readLength;
}
std::string fieldValue = std::string(buf, bufIdx);
This shortcut would be nice:
std::string fieldValue = parser.getFieldValue();
Additional context