You are on page 1of 2

HTTP Requests

Crear
good:
curl \
-i \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"titulo":"The Title will go here","descripcion":"The Descripcion"}' \
http://localhost:3000/api/todo_lists.json
bad:
curl \
-i \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X POST \
-d '{"titulo":"The Title will go here","descripcion":""}' \
http://localhost:3000/api/todo_lists.json
Eliminar
curl \
-i \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X DELETE \
http://localhost:3000/api/todo_lists/4.json
Actualizar
curl \
-i \
-H "Accept: application/json" \
-H "Content-type: application/json" \
-X PUT \
-d '{"titulo":"The Title will go here","descripcion":"The nueva
Descripcion"}' \
http://localhost:3000/api/todo_lists/5.json
curl \
--basic \
-u cesar_notes@outlook.com:newpassnew \
http://localhost:3000/api/todo_lists.json
curl \
--basic \
-u cesar:cats \

http://localhost:3000/api/todo_lists.json

You might also like