node-fetch
Advanced tools
Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6
@@ -22,2 +22,3 @@ | ||
- Other: update package.json script for npm 5 | ||
- Other: `encoding` module is now optional | ||
@@ -37,2 +38,4 @@ ### HTTP requests | ||
- Enhance: add experimental `response.blob()` (also applies to Requests) | ||
- Enhance: `URLSearchParams` is now accepted as a body | ||
- Enhance: wrap `response.json()` json parsing error as `FetchError` | ||
- Fix: fix Request and Response with `null` body | ||
@@ -39,0 +42,0 @@ |
{ | ||
"name": "node-fetch", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "A light-weight module that brings window.fetch to node.js", | ||
@@ -56,7 +56,6 @@ "main": "lib/index.js", | ||
"rollup-plugin-babel": "^2.6.1", | ||
"url-search-params": "^0.9.0", | ||
"whatwg-url": "^4.0.0" | ||
}, | ||
"dependencies": { | ||
"encoding": "^0.1.11" | ||
} | ||
"dependencies": { } | ||
} |
@@ -140,2 +140,12 @@ | ||
// post form parameters (x-www-form-urlencoded) | ||
import { URLSearchParams } from 'url'; | ||
const params = new URLSearchParams(); | ||
params.append('a', 1); | ||
fetch('http://httpbin.org/post', { method: 'POST', body: params }) | ||
.then(res => res.json()) | ||
.then(json => console.log(json)); | ||
// post with form-data (detect multipart) | ||
@@ -142,0 +152,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
88845
0
411
20
1
- Removedencoding@^0.1.11
- Removedencoding@0.1.13(transitive)
- Removediconv-lite@0.6.3(transitive)
- Removedsafer-buffer@2.1.2(transitive)