Skip to content

finnp/node-get-accepted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Module for enforcing mime types in a GET request.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published