Amith Shaju
Amith Shaju

Reputation: 135

Post gives Request Body as nil in Kitura

I tried posting a request to my localhost with a json body from REST CLIENT & POSTMAN and also from terminal. But always the request.body is nil. Using package : .Package(url: "https://github.com/IBM-Swift/Kitura", majorVersion: 1, minor: 1).

Upvotes: 2

Views: 553

Answers (1)

skallner
skallner

Reputation: 226

Please make sure that you have added the BodyParser middleware to your routes. For example:

let router = Router()

router.all(middleware: BodyParser())

Shmuel Kallner

Upvotes: 7

Related Questions