get-accepted

0.0.1 • Public • Published

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);
  }
});
 

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i get-accepted

      Weekly Downloads

      1

      Version

      0.0.1

      License

      MIT

      Last publish

      Collaborators

      • finnpauls