Processing HTTP POST payload at the Server Side


If I do a HTTP POST using the below content as Raw JSON body, what would be the correct way to retrieve this on the Server Side using v8js? Just wanted to know how’s the json validated at the server side? And also how to make sure that they keys you are expecting are available in the json that’s posted?

I posted the below json (using postman) and under this you can see the code that i used to print the payload at the server side.

  "resource": [
      "name": "John",
      "first_name": "John",
      "last_name": "Doe",
      "email": "",
      "password": "secret"

Below is the code used on the server side to just print what’s received. Would this be the right way to access the payload data on the server side? If yes then I could go ahead with what I’d do to validate json data

var lodash = require("lodash.min.js");

if (event.request.method !== "POST") {
    throw ("Only HTTP POST is allowed on this service!");

event.response.status_code = 200;
event.response.content_type = "application/json;charset=utf-8";
event.response.content = JSON.parse(JSON.stringify({
	"status_code": 200,
	"content": event.request.payload

// Process event.request.payload