Vapor – How do I return a JSON response with a specific Status Code?

50 viewsapihttpresponsejsonvapor
0

Disclaimer: this question originally asked on the Vapor help channel on Slack

Easy question: if I’m sending a response like this

let response: ResponseRepresentable = try JSON(node: ["message": "User Created"])`

How can i set the status code for the response?