From 1cc585ba9973d5c4ae9277381c0f80030ddef027 Mon Sep 17 00:00:00 2001 From: Matt Huntington Date: Wed, 3 May 2017 22:03:10 -0400 Subject: [PATCH] fetch examples --- js/index.js | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/js/index.js b/js/index.js index 5761e3b..c14d3f5 100644 --- a/js/index.js +++ b/js/index.js @@ -4,11 +4,27 @@ import App from './components/app.js'; import { Provider } from 'react-redux' import store from './store.js' -fetch('https://stupidcomments.herokuapp.com/comments').then(function(response){ - response.json().then(function(data){ - console.log(data); - }); -}); +// fetch('https://stupidcomments.herokuapp.com/comments').then(function(response){ +// response.json().then(function(data){ +// console.log(data); +// }); +// }); + +// fetch( +// 'https://stupidcomments.herokuapp.com/comments', +// { +// headers: { +// 'Accept': 'application/json', +// 'Content-Type': 'application/json' +// }, +// method: "POST", +// body: JSON.stringify({ body:'from react' }) +// } +// ).then(function(response){ +// response.json().then(function(data){ +// console.log(data); +// }); +// }); ReactDOM.render(