eshimel / project2-api

WDI Project 2 backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

User authentication

Register

curl --include --request POST --header "Content-Type: application/json" -d '{
  "credentials": {
    "email": "an@example.email",
    "password": "an example password",
    "password_confirmation": "an example password"
  }
}' http://localhost:3000/register

Login

curl --request POST --header "Content-Type: application/json" -d '{
  "credentials": {
    "email": "an@example.email",
    "password": "an example password"
  }
}' http://localhost:3000/login

Logout

curl --request DELETE --header "Authorization: Token token=c017d611187e3350baffc52d35a4df69" http://localhost:3000/logout/1

curl --request DELETE --header "Authorization: Token token=e1e55f2a1f86f3a99c38849b1f0a1f19" http://localhost:3000/logout/1

Users

List

curl --header "Authorization: Token token=c017d611187e3350baffc52d35a4df69" http://localhost:3000/users

Books

List

curl --header "Authorization: Token token=c017d611187e3350baffc52d35a4df69" http://localhost:3000/users

OR

curl http://localhost:3000/users

Create

curl --request POST --header "Authorization: Token token=be249dc0231396806f24c953cafae03a" --header "Content-Type: application/json" -d '{
  "book": {
    "title":"The Hold",
    "isbn":"abc123def456"
  }
}'  http://localhost:3000/books

About

WDI Project 2 backend


Languages

Language:Ruby 85.4%Language:HTML 14.6%