loentar / ngrest

Fast and easy C++ RESTful WebServices framework
Apache License 2.0
464 stars 93 forks source link

Modify return string from {"result":"text"} to text or {text} or ... #76

Closed MG-Sika closed 3 years ago

MG-Sika commented 3 years ago

Is it possible to modify the API-Response from the static format {"result":"text"} to a different format?

I prefer to return only a string that have to be formatted by the callback.

loentar commented 3 years ago

Try using inlineResult like this:

// *inlineResult: true
std::string echo(const std::string& text);
MG-Sika commented 3 years ago

Thanks. It solves my problem.