Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
针对HTTP/1.1封装的客户端请求库。
基于Promise实现,可以通过then接收返回结果,或者配合async/await使用。
npm i gohttp
const gohttp = require('gohttp');
gohttp.get('http://localhost:2020/')
.then(res => {
console.log(res.headers, res.status);
return res.text();
})
.then(result => {
console.log(result);
});
const gohttp = require('gohttp');
gohttp.post('http://localhost:2020/p', {
body : {
user: 'wang'
}
})
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
const gohttp = require('gohttp');
gohttp.put('http://localhost:2020/p', {
body : {
user: 'wang'
}
})
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
const gohttp = require('gohttp');
gohttp.delete('http://localhost:2020/p/123')
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
const gohttp = require('gohttp');
gohttp.upload('http://localhost:2020/upload', {
files: {
image: [
'pictures/a.jpg',
'pictures/b.png'
],
video: [
'videos/a.mp4',
'videos/b.mp4'
]
},
//要携带表单数据需要form选项
//form : {}
})
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
基于gohttp.upload封装的up函数参数更加简单:
gohttp.up('http://localhost:1234/upload', {
name : 'image'
file : 'images/123.jpg'
}).then(res => {
return res.text();
}).then(d => {
console.log(d);
});
const gohttp = require('gohttp');
gohttp.download('https://localhost:2021/download', {
dir: process.env.HOME + '/download/',
//输出进度提示
progress: true
}).then(d => {
console.log(d || '');
}).catch(err => {
console.error(err);
});
FAQs
http & https client for HTTP/1.1 and HTTP/2
The npm package gohttp receives a total of 138 weekly downloads. As such, gohttp popularity was classified as not popular.
We found that gohttp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.