I wanted to easily make HTTP requests (both GET & POST) with a simple interface that returns promises.
The popular request
& request-promises
package are good, but I wanted to figure out how to do it w/out using external dependencies.
The key features are:
- the ability to set a timeout
- non-200 responses are considered errors that reject the promise.
- any errors at the TCP socker/DNS level reject the promise.