forked from gSchool/galvanize-bookshelf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsample_POST.js
40 lines (26 loc) · 1.21 KB
/
sample_POST.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*** BOOKS ***/
//POST / add()
http -p HBhb POST localhost:8000/books title='Some Title' author='Some Author' genre='Horror' description='something something' cover_url='site.com/cover.jpg'
//PATCH / update()
http -p HBhb PATCH localhost:8000/books/9 title='Changed Title'
http -p HBhb PATCH localhost:8000/books/9 author='Changed author'
http -p HBhb PATCH localhost:8000/books/9 genre='Changed genre'
http -p HBhb PATCH localhost:8000/books/9 description='Changed desc'
http -p HBhb PATCH localhost:8000/books/9 cover_url='Changed URL'
//PATCH bad - index too high
http -p HBhb PATCH localhost:8000/books/999 cover_url='Changed URL'
//bad - index too low
http -p HBhb PATCH localhost:8000/books/-1 cover_url='Changed URL'
//bad - index nan
http -p HBhb PATCH localhost:8000/books/hi cover_url='Changed URL'
//DELETE remove()
http -p HBhb DELETE localhost:8000/books/10
/*** USERS ***/
//POST / register()
http -p HBhb POST :8000/users first_name='John' last_name='Siracusa' email='[email protected]' password='ilikebigcats'
/*** TOKEN ***/
http -p HBhb POST :8000/token email='[email protected]' password='youreawizard'
http -p HBhb GET :8000/token
/*** FAVORITES ***/
//GET /favorites
http -p HBhb :8000/favorites