Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 1 addition & 24 deletions src/documentation/0039-node-http-post/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,7 @@ axios
})
```

Another way is to use the [Request library](https://github.com/request/request):

```js
const request = require('request')

request.post(
'https://whatever.com/todos',
{
json: {
todo: 'Buy the milk'
}
},
(error, res, body) => {
if (error) {
console.error(error)
return
}
console.log(`statusCode: ${res.statusCode}`)
console.log(body)
}
)
```

The 2 ways highlighted up to now require the use of a 3rd party library.
Axios requires the use of a 3rd party library.

A POST request is possible just using the Node.js standard modules, although it's more verbose than the two preceding options:

Expand Down