Skip to content

Add crow::json::returnable class#1155

Closed
CarloDG80 wants to merge 1 commit into
CrowCpp:masterfrom
CarloDG80:json_returnable
Closed

Add crow::json::returnable class#1155
CarloDG80 wants to merge 1 commit into
CrowCpp:masterfrom
CarloDG80:json_returnable

Conversation

@CarloDG80
Copy link
Copy Markdown
Contributor

  • Add crow::json::returnable class
    An utilty to return a JSON string build by an external library/tool.

  • Add "operator double()" to crow::json::rvalue

Add "operator double()" to crow::json::rvalue
@gittiver
Copy link
Copy Markdown
Member

gittiver commented Mar 5, 2026

I will not add the returnable subclass to the library,
you can use response (std::string contentType, std::string body_) instead.

return response("json", your_body_string) should work.

@gittiver gittiver closed this Mar 5, 2026
@CarloDG80
Copy link
Copy Markdown
Contributor Author

I will not add the returnable subclass to the library, you can use response (std::string contentType, std::string body_) instead.

return response("json", your_body_string) should work.

Super,
Thank you

@CarloDG80 CarloDG80 deleted the json_returnable branch March 6, 2026 08:09
@CarloDG80
Copy link
Copy Markdown
Contributor Author

Would you like something like this?

static inline crow::response makeJsonResp(std::string jsonData) {
    return crow::response("json", jsonData );
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants