Permalink
Browse files

Update README.md

  • Loading branch information...
esthersweon authored and GitHub committed Jan 30, 2018
1 parent 7e0613a commit 45f62113d75d8d7c3e005fffe0b4bd6b7b87606a
Showing with 11 additions and 5 deletions.
  1. +11 −5 README.md
@@ -65,8 +65,11 @@ Fetch documentation [here](https://developer.mozilla.org/en-US/docs/Web/API/Fetc
Fetch GET request:

```javascript
fetch('http://localhost:8080/api/posts').then(res => {
console.log(res.json());
fetch('http://localhost:8080/api/posts').then((res) => {
return res.json();
}).then((json) => {
// do stuff with the JSON you get back here
console.log(json);
});
```

@@ -86,9 +89,12 @@ fetch('http://localhost:8080/api/posts', {
votes: 3,
comments: []
})
}).then(function(response) {
return response.json()
})
}).then((res) => {
return res.json()
}).then((json) => {
// do stuff with the JSON you get back here
console.log(json)
});
```

### Implementing User Stories

0 comments on commit 45f6211

Please sign in to comment.