Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gohttp

Package Overview
Dependencies
Maintainers
1
Versions
125
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gohttp - npm Package Compare versions

Comparing version 3.2.5 to 3.2.6

LICENSE

8

package.json
{
"name": "gohttp",
"version": "3.2.5",
"version": "3.2.6",
"description": "http client for HTTP/1.1",

@@ -11,3 +11,3 @@ "main": "gohttp.js",

"type": "git",
"url": "git+https://github.com/master-genius/httpcli.git"
"url": "https://gitee.com/daoio/gohttp"
},

@@ -30,5 +30,5 @@ "keywords": [

"bugs": {
"url": "https://github.com/master-genius/httpcli/issues"
"url": "https://gitee.com/daoio/gohttp/issues"
},
"homepage": "https://github.com/master-genius/httpcli#readme"
"homepage": "https://gitee.com/daoio/gohttp/blob/master/README.md"
}

@@ -53,2 +53,37 @@

## PUT请求
``` Javascript
const gohttp = require('gohttp');
gohttp.put('http://localhost:2020/p', {
body : {
user: 'wang'
}
})
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
```
## DELETE请求
``` JavaScript
const gohttp = require('gohttp');
gohttp.delete('http://localhost:2020/p/123')
.then(res => {
return res.text();
})
.then(result => {
console.log(result);
});
```
## 上传文件

@@ -70,3 +105,5 @@

]
}
},
//要携带表单数据需要form选项
//form : {}
})

@@ -81,1 +118,36 @@ .then(res => {

```
## 简单上传
基于gohttp.upload封装的up函数参数更加简单:
``` JavaScript
gohttp.up('http://localhost:1234/upload', {
name : 'image'
file : 'images/123.jpg'
}).then(res => {
return res.text();
}).then(d => {
console.log(d);
});
```
## 下载文件
``` JavaScript
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.log(err);
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc