Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
A flowHttp extension used for whitelisting HTTP status codes
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

flowHttp-status

A flowHttp extension used for whitelisting HTTP status codes.

build
status

Install

npm install flowhttp-status

Usage

Use this module to create a PassThrough stream that will emit an error event if the response from the flowHttp module doesn't validate against a specified whitelist of HTTP status codes.

E.g. only allow the two HTTP status codes 200 and 204. If the GET request for example.com returns anything other than those two status codes, an error event will be emitted on the stream:

var flowHttp = require('flowhttp');
var ValidCodes = require('flowhttp-status');

flowHttp('http://example.com')
  .pipe(new ValidCodes(200, 204))
  .pipe(process.stdout);

License

MIT

Something went wrong with that request. Please try again.