Debugging Event Payloads

Important: These docs are for the outdated Jets 5 versions and below. For the latest Jets docs: docs.rubyonjets.com

Here are examples of event payloads for a typical CRUD controller. They help to figure out what are the minimum required keys.

posts#index

{
  "path": "/posts",
  "httpMethod": "GET",
  "headers": {
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  }
}

posts#show

{
  "path": "/posts/1",
  "httpMethod": "GET",
  "headers": {
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  }
}

posts#new

{
  "path": "/posts/new",
  "httpMethod": "GET",
  "headers": {
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  }
}

posts#edit

{
  "path": "/posts/edit/1",
  "httpMethod": "GET",
  "headers": {
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  }
}

posts#create

{
  "path": "/posts",
  "httpMethod": "POST",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  },
  "body": "{\"post\":{\"title\":\"Post 3\",\"body\":\"Body 3\",\"published\":true}}"
}

posts#update

{
  "path": "/posts/3",
  "httpMethod": "PUT",
  "headers": {
    "content-type": "application/x-www-form-urlencoded",
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  },
  "body": "{\"post\":{\"title\":\"Post 3\",\"body\":\"Body 3\",\"published\":true}}"
}

posts#destroy

{
  "path": "/posts/3",
  "httpMethod": "DELETE",
  "headers": {
    "Host": "foobar.execute-api.us-west-2.amazonaws.com"
  }
}