assert-successful-request

Simple callback function to assert successful HTTP responses made with the request module


Keywords
assert, http, request, successful, response, status, code
License
MIT
Install
npm install assert-successful-request@1.0.2

Documentation

assert-successful-request

Simple callback function to assert successful HTTP responses made with the request module

How to use

const assertSuccessfulResponse = require('assert-successful-request')

request({ uri: 'https://google.com' }, assertSuccessfulResponse)

Simply pass the function as a callback to your request-call to assert that the request was successful.

A request is considered successful if it it resulted in a non-error HTTP status code.