Guest User

Untitled

a guest
Nov 22nd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. var params = {
  2. grocery_list_name: 'MY_grocery_LIST',
  3. items: [{
  4. "product":"320",
  5. "price" : "6.99",
  6. "quantity" : "2",
  7. "special_deal":"1",
  8. "template":"1"
  9. },{
  10. "product":"321",
  11. "price" : "7.99",
  12. "quantity" : "3",
  13. "special_deal":"2",
  14. "template":"2"
  15. },]
  16. };
  17. try {return fetch(URL, { method: 'POST', headers: {
  18. 'Authorization': 'bearer AtE9slkuafhebbjKkYe0tTimMZc',
  19. 'Content-Type': 'application/json'},
  20. body: JSON.stringify(params),})
  21. .then(function(response){
  22. console.log(response);
  23. return response.json();
  24. })
  25. } catch (error) {
  26. console.error(error);
  27. } finally { }
Add Comment
Please, Sign In to add comment