0.0.1 • Published 10 years ago

get-accepted v0.0.1

Weekly downloads
2
License
MIT
Repository
-
Last release
10 years ago

get-accepted

This module sets the accept header of a get request to a url to the specified mimetypes and then also aborts the request when the returned mimetypes don't match this mimetypes.

It doesnt support wildcard mimetypes yet.

Install with npm install get-accepted.

Usage

var getAccepted = require('get-accepted');

var url = 'http://www.npmjs.org';
var mimetypes = ['text/html'];

getAccepted(url, mimetypes, function (res) {
  if (res) {
    res.pipe(process.stdout);
  }
});