Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TOKEN API
- curl --data "username=admin&password=adminadmin" http://127.0.0.1:8000/api-token-auth/
- MEALS API
- curl -X GET http://127.0.0.1:8000/api/meals/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X POST -H "Content-Type: application/json" -d ' {
- "name": 16,
- "time": "15:00"
- }' http://127.0.0.1:8000/api/add_meal/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X GET http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X PUT -H "Content-Type: application/json" -d ' {
- "name": 16,
- "time": "17:00"
- }' http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X DELETE http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- RECIPES API
- curl -X GET http://127.0.0.1:8000/api/own_recipe_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X GET http://127.0.0.1:8000/api/recipe_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X POST -H "Content-Type: application/json" -d ' {
- "name": "Test recipe123",
- "description": "Trying to post recipe",
- "ingredients":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/add_recipe/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X GET http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X PUT -H "Content-Type: application/json" -d ' {
- "name": "Test recipe123",
- "description": "Trying to post recipe",
- "ingredients":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X DELETE http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- SHOPPING LIST API
- curl -X GET http://127.0.0.1:8000/api/shopping_lists/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X POST -H "Content-Type: application/json" -d ' {
- "name": "Test recipe123",
- "description": "Trying to post recipe",
- "items":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/add_shopping_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X GET http://127.0.0.1:8000/api/shopping_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X PUT -H "Content-Type: application/json" -d ' {
- "name": "Te12t recip12e12",
- "description": "Trying to post recipe",
- "items":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/shopping_list/2/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X DELETE http://127.0.0.1:8000/api/shopping_list/2/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- PRODUCT LIST API
- curl -X GET http://127.0.0.1:8000/api/product_lists/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X POST -H "Content-Type: application/json" -d ' {
- "name": "Test recipe123",
- "description": "Trying to post recipe",
- "items":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/add_product_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X GET http://127.0.0.1:8000/api/product_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X PUT -H "Content-Type: application/json" -d ' {
- "name": "Test recipe12",
- "description": "Trying to post recipe",
- "items":
- [
- {"name": "First ingredient", "value": "5", "unit": "kg"}
- ]
- }' http://127.0.0.1:8000/api/product_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
- curl -X DELETE http://127.0.0.1:8000/api/product_list/2/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement