easier-http-request
v0.1.0
Published
Easier HTTP(S) request method. Wraps the Fetch API with some additional features and conveniences.
Maintainers
Readme
Easier HTTP request
Simple wrapper around the fetch API.
Extends fetch in the following ways:
- Accepts URL parameters as an object
- Accepts headers as a single object
- If body is given as plain object, automatically converts it to JSON
- Supports setting a timeout for waiting until headers are returned by the server
- Errors if response doesn't have a 2xx status code
- Produces machine-readable error objects, including information about the status and state of the response
- On success, returns the result object produced by
fetch
Installation
npm install easier-http-request