Skip to content
Yuki Takei edited this page Oct 10, 2016 · 3 revisions

Request

Register BodyParser.JSON into the middleware chains.

Can get parsed requested json body throgh the req.json when content-type is application/json.
req.json returns SwiftyJSON.JSON?

app.use(BodyParser.JSON())

app.use { request, _, _ in
    request.json!["foo"]!.string
}

Response

Clone this wiki locally