Gathering detailed insights and metrics for native-request
Gathering detailed insights and metrics for native-request
Gathering detailed insights and metrics for native-request
Gathering detailed insights and metrics for native-request
request-promise-native
The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.
cacheable-request
Wrap native HTTP requests with RFC compliant cache support
@types/request-promise-native
TypeScript definitions for request-promise-native
@algolia/requester-node-http
Promise-based request library for node using the native http module.
A simple package with no dependencies for native requests using callback
npm install native-request
Typescript
Module System
Node Version
NPM Version
87.1
Supply Chain
99.5
Quality
77.7
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
205,413,237
Last Day
17,119
Last Week
545,944
Last Month
2,321,522
Last Year
30,493,635
4 Stars
42 Commits
2 Watching
5 Branches
2 Contributors
Minified
Minified + Gzipped
Latest Version
1.1.2
Package Id
native-request@1.1.2
Unpacked Size
29.80 kB
Size
5.48 kB
File Count
13
NPM Version
8.19.2
Node Version
20.7.0
Publised On
24 Aug 2024
Cumulative downloads
Total Downloads
Last day
-8.7%
17,119
Compared to previous day
Last week
-5.2%
545,944
Compared to previous week
Last month
-10.4%
2,321,522
Compared to previous month
Last year
-37.7%
30,493,635
Compared to previous year
4
Native Request is a simple module that makes you create native node.js requests supports https.
Install the dependencies and devDependencies and start the server.
1npm install native-request
Easy
1let request = require('native-request'); 2 3request.request({ 4 url: "http://github.com/", 5 method: 'POST', 6 }, function(err, data, status, headers) { 7 console.log(status); //200 8 console.log(data); // page content 9 console.log(headers); // response headers 10}); 11
Full
1let request = require('native-request'); 2 3request.request({ 4 url: "http://github.com/", 5 method: 'POST', 6 Cookies: { john: "doe", human: true }, 7 headers: { 8 authorization: "Token121" 9 }, 10 requestOptions: { 11 followRedirect: false, 12 maxRedirect: 1, 13 trustRedirect: false 14 } 15 16 }, function(err, data, status, headers) { 17 console.log(status); //200 18 console.log(data); // page content 19 console.log(headers); // response headers 20}); 21
Options | Required | Type | Parameters | Default |
---|---|---|---|---|
url | ✓ | String | Target url | |
method | ✓ | String | HTTP method to use. More info here | |
Headers | JSON Object | Pass headers to the request with a JSON format. | {"content-type": "application/json"} | |
Cookies | JSON Object | Pass cookies to the request with a JSON format | ||
requestOptions | See below |
The parameters below are here for client configuration. None of these parameters will be sent. These parameters must be put in the object 'requestOptions'
Options | Required | Type | Parameters | Default |
---|---|---|---|---|
followRedirect | boolean | Decide if we should follow the redirects | true | |
maxRedirect | int | Decide the maximum number of redirects allowed | 3 | |
trustRedirect | boolean | If false, headers will not be sent when a redirect happen | true |
1let request = require('native-request'); 2request.get('https://github.com', function(err, data, status, headers) { 3 if (err) { 4 throw err; 5 } 6 console.log(status); //200 7 console.log(data); // page content 8 console.log(headers); // response headers 9});
To add custom headers just do like this:
1let request = require('native-request'); 2 3let headers = { 4 "content-type": "plain/text" 5} 6request.get('https://github.com', headers, function(err, data, status, headers) { 7 if (err) { 8 throw err; 9 } 10 console.log(status); //200 11 console.log(data); // page content 12 console.log(headers); // response headers 13});
request.post(path, callback)
request.post(path, data, callback)
request.post(path, data, headers, callback)
To send an empty post:
1let request = require('native-request'); 2request.post('https://github.com', function(err, data, status, headers) { 3 if (err) { 4 throw err; 5 } 6 console.log(status); //200 7 console.log(data); // page content 8 console.log(headers); // response headers 9});
With headers and data:
1let request = require('native-request'); 2 3let data = { 4 "example": true, 5} 6let headers = { 7 "content-type": "plain/text" 8} 9request.post('https://github.com', data, headers, function(err, data, status, headers) { 10 if (err) { 11 throw err; 12 } 13 console.log(status); //200 14 console.log(data); // page content 15 console.log(headers); // response headers 16});
MIT. Copyright (c) Samuel Marchese.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/20 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
license file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
12 existing vulnerabilities detected
Details
Score
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More