ga-wdi-boston / rails-api

Introduction to MVC concepts and their implementation in Rails.
Other
6 stars 159 forks source link

Failed curl request in README #45

Open Jcornmanhomonoff opened 7 years ago

Jcornmanhomonoff commented 7 years ago

The curl requested listed in the README fails as a result of missing a parameter (user_id). Using this as a teaching moment to show how to reference the files in the back end to find the proper parameters to pass through for a successful POST.

Correct script:


curl http://localhost:4741/posts \
--include \
--request POST \
--header "Content-Type: application/json" \
--data '{
    "post": {
      "title": "a sample title",
      "body": "a sample body",
      "user_id": 1
    }
  }'