Skip to content
This repository was archived by the owner on Jul 28, 2023. It is now read-only.

Commit 3a1376d

Browse files
author
Hoang Trieu, Khang
committed
chore(network): add tests
1 parent 7ff13dc commit 3a1376d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

foo.js

+14
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,17 @@ const fetch = require('node-fetch');
33
fetch('http://jsonplaceholder.typicode.com/todos/5');
44

55
fetch('https://developers.video.ibm.com/images/example-channel-nasa.jpg')
6+
7+
fetch('https://jsonplaceholder.typicode.com/posts', {
8+
method: 'POST',
9+
body: JSON.stringify({
10+
title: 'foo',
11+
body: 'bar',
12+
userId: 1
13+
}),
14+
headers: {
15+
'Content-type': 'application/json; charset=UTF-8'
16+
}
17+
})
18+
.then(response => response.json())
19+
.then(json => console.log(json))

0 commit comments

Comments
 (0)