vibe.d in techempower web framework benchmark

Dicebot m.strashun at gmail.com
Thu Apr 25 02:31:18 PDT 2013


On Thursday, 25 April 2013 at 09:26:19 UTC, 1100110 wrote:
> ...
> void handleJson(HttpServerRequest req, HttpServerResponse res)
> {
>     Json tmp = serializeToJson(["message":"Hello, World!"]);
>     res.writeBody(tmp.to!string, "application/json");
>
>     /** Does this one still meet the qualifications,
>      *  and which should be used?
>      * res.writeJsonBody(["message":"Hello, World!"]);
>      */
> }
> ...

They are exactly the same. writeJsonBody calls the very same 
serializeToJson inside.


More information about the Digitalmars-d mailing list