
Security News
Happy Birthday, Shai-Hulud
It has been one year since Shai-Hulud made its first appearance on npm.
request-agent
Advanced tools
npm install request-agent --save
const requestAgent = require('request-agent');
requestAgent.headers({'content-type':'application/json'})
.headers({ 'user-agent':'customer UA' , 'power-by':'lanhao@fyscu' })
.query({ 'page':1 , 'pageSize':10 })
.query({ '_t':1465317270 })
.body({ 'title':'I say' , 'content':'Nothing' })
.method('post')
.send()
.then(requestAgent.toJson) // this step is optional
.then( (obj) => {
//do something
console.log(obj);
})
.catch( (err) => {
//error handler
console.trace(err);
});
requestAgent.headers({'content-type':'application/json'} [ ,flush=false ])
setting multi-headers in 2 ways:
requestAgent.headers({'content-type':'application/json','UA':'MyAgent'})
or
requestAgent.headers({'content-type':'application/json'}).headers({'UA':'MyAgent'})
Parameter flush , default false ,told the request-agent clear the old headers or not.
requestAgent.query({'_t':1441089765} [ ,flush=false ])
some like headers .
requestAgent.body({'content':'I send this message to server'} [ ,flush=false ])
some like headers .
FAQs
## Install
We found that request-agent demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.

Security News
It has been one year since Shai-Hulud made its first appearance on npm.

Research
/Security News
Operators behind PolinRider used a compromised GitHub account to plant malware in four development versions of a Packagist package with 700,000+ downloads.

Security News
GitHub Actions now supports cache-mode, a least-privilege control on the Actions cache aimed at the cache poisoning technique behind recent compromises.