Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
app
bin
config
db
lib
log
public
vendor/assets
.gitignore
Gemfile
Gemfile.lock
README.md
Rakefile
config.ru

README.md

Request Handler Demo

Installation

$ git clone git@github.com:MatthewRDodds/request-handler-demo.git
$ cd request-handler-demo
$ bundle install

Setup

bin/rake db:create db:migrate db:seed

Demo Requests

Valid Request

curl -XPOST \
     -H "Accept: application/json" \
     -H "Content-type: application/json" \
     -d '{"check_out":{"user_id":"1","book_id":"1"}}' \
     http://localhost:3000/api/check_outs

Invalid Request(s)

curl -XPOST \
     -H "Accept: application/json" \
     -H "Content-type: application/json" \
     -d '{"check_out":{"book_id":"1"}}' \
     http://localhost:3000/api/check_outs
curl -XPOST \
     -H "Accept: application/json" \
     -H "Content-type: application/json" \
     -d '{"check_out":{"user_id":"1"}}' \
     http://localhost:3000/api/check_outs