Advertisement
Guest User

Untitled

a guest
May 10th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. TOKEN API
  2. curl --data "username=admin&password=adminadmin" http://127.0.0.1:8000/api-token-auth/
  3.  
  4.  
  5. MEALS API
  6.  
  7. curl -X GET http://127.0.0.1:8000/api/meals/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  8. curl -X POST -H "Content-Type: application/json" -d ' {
  9. "name": 16,
  10. "time": "15:00"
  11. }' http://127.0.0.1:8000/api/add_meal/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  12. curl -X GET http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  13. curl -X PUT -H "Content-Type: application/json" -d ' {
  14. "name": 16,
  15. "time": "17:00"
  16. }' http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  17. curl -X DELETE http://127.0.0.1:8000/api/meal/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  18.  
  19.  
  20. RECIPES API
  21.  
  22. curl -X GET http://127.0.0.1:8000/api/own_recipe_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  23. curl -X GET http://127.0.0.1:8000/api/recipe_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  24. curl -X POST -H "Content-Type: application/json" -d ' {
  25. "name": "Test recipe123",
  26. "description": "Trying to post recipe",
  27. "ingredients":
  28. [
  29. {"name": "First ingredient", "value": "5", "unit": "kg"}
  30. ]
  31. }' http://127.0.0.1:8000/api/add_recipe/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  32. curl -X GET http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  33. curl -X PUT -H "Content-Type: application/json" -d ' {
  34. "name": "Test recipe123",
  35. "description": "Trying to post recipe",
  36. "ingredients":
  37. [
  38. {"name": "First ingredient", "value": "5", "unit": "kg"}
  39. ]
  40. }' http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  41. curl -X DELETE http://127.0.0.1:8000/api/recipe/16/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  42.  
  43.  
  44. SHOPPING LIST API
  45.  
  46. curl -X GET http://127.0.0.1:8000/api/shopping_lists/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  47. curl -X POST -H "Content-Type: application/json" -d ' {
  48. "name": "Test recipe123",
  49. "description": "Trying to post recipe",
  50. "items":
  51. [
  52. {"name": "First ingredient", "value": "5", "unit": "kg"}
  53. ]
  54. }' http://127.0.0.1:8000/api/add_shopping_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  55. curl -X GET http://127.0.0.1:8000/api/shopping_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  56. curl -X PUT -H "Content-Type: application/json" -d ' {
  57. "name": "Te12t recip12e12",
  58. "description": "Trying to post recipe",
  59. "items":
  60. [
  61. {"name": "First ingredient", "value": "5", "unit": "kg"}
  62. ]
  63. }' http://127.0.0.1:8000/api/shopping_list/2/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  64. curl -X DELETE http://127.0.0.1:8000/api/shopping_list/2/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  65.  
  66.  
  67. PRODUCT LIST API
  68.  
  69. curl -X GET http://127.0.0.1:8000/api/product_lists/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  70. curl -X POST -H "Content-Type: application/json" -d ' {
  71. "name": "Test recipe123",
  72. "description": "Trying to post recipe",
  73. "items":
  74. [
  75. {"name": "First ingredient", "value": "5", "unit": "kg"}
  76. ]
  77. }' http://127.0.0.1:8000/api/add_product_list/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  78. curl -X GET http://127.0.0.1:8000/api/product_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  79. curl -X PUT -H "Content-Type: application/json" -d ' {
  80. "name": "Test recipe12",
  81. "description": "Trying to post recipe",
  82. "items":
  83. [
  84. {"name": "First ingredient", "value": "5", "unit": "kg"}
  85. ]
  86. }' http://127.0.0.1:8000/api/product_list/1/ -H 'Authorization: Token bd59ce8ef1e749d74f9e1549384b04829ce83c86'
  87. 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