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.

Reply via email to