
Product
Socket Brings Supply Chain Security to skills.sh
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.
一个简单好用的HTTP请求库。
使用NPM安装
$ npm install jsreq
使用CNPM安装
$ cnpm install jsreq
首先引用
const jsreq = require('jsreq');
支持多种调用方式,返回一个Promise。
let url = 'http://www.example.com'
let options = {
method:'POST',
uri:'http://www.example.com',
data:'I am data',
headers:{
aaa:'aaa',
bbb:'bbb'
}
}
jsreq(url,options).then(console.log) // 方式一
jsreq(url).then(console.log) // 方式二
jsreq(options).then(console.log) // 方式三
对于url,你可以单独拿出来放在参数的第1项,也可以放在 options 参数中。
其中 options 支持以下参数
let options = {
url:'https://www.example.com',
uri:'https://www.example.com', // url的别名
path:'/path/to?name=mark',
query:{ // query对象
age:19,
isGood:true
},
method:'POST',
data:'I am data',
headers:{
aaa:'aaa',
bbb:'bbb'
}
}
响应是一个对象,包含以下属性:
例如
{
statusCode:200,
statusMessage:'OK',
headers:{
'date': 'Mon, 30 Mar 2020 14:13:26 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '1179',
},
data:'I am response data'
}
FAQs
An easy and simple Node.js HTTP client.
The npm package jsreq receives a total of 3 weekly downloads. As such, jsreq popularity was classified as not popular.
We found that jsreq 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.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket is now scanning AI agent skills across multiple languages and ecosystems, detecting malicious behavior before developers install, starting with skills.sh's 60,000+ skills.

Product
Socket now supports PHP with full Composer and Packagist integration, enabling developers to search packages, generate SBOMs, and protect their PHP dependencies from supply chain threats.

Security News
An AI agent is merging PRs into major OSS projects and cold-emailing maintainers to drum up more work.