New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

isomorphic-fetch-http

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isomorphic-fetch-http - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

2

package.json
{
"name": "isomorphic-fetch-http",
"version": "0.2.4",
"version": "0.2.5",
"description": "react fetch by isomorphic-fetch",

@@ -5,0 +5,0 @@ "main": "lib/isomorphic-fetch-http.js",

@@ -16,3 +16,36 @@ ## isomorphic-fetch-http

```javascript
import { $get, $post, $put, $delete, $option } from 'isomorphic-fetch-http'
import { http } from 'isomorphic-fetch-http'
// 全局配置
http.setup({
prefix: '/api', // url 前缀
header: {}, // 自定义请求头
exception: ['INVALIDError'] // 自定义捕获类型
});
// get方法 一般用于查询
// @param {Object} param
// @return {Object} {status, data, message}
return http.get('url', param);
// post方法 一般用于数据提交
// @param {Object} param
// @return {Object} {status, data, message}
return http.post('url', param);
// put方法 一般用于数据修改
// @param {Object} param
// @return {Object} {status, data, message}
// return http.put('url', param);
// delete方法 一般用于数据删除
// @param {Object} param
// @return {Object} {status, data, message}
return http.delete('url', param);
// option方法 本质是请求头为 "Content-Type": "application/json" 的post方法
// @param {Object} param
// @return {Object} {status, data, message}
return http.option('url', param);
```

@@ -19,0 +52,0 @@

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