@digitalbazaar/http-client
Advanced tools
Comparing version 1.0.0 to 1.1.0
# @digitalbazaar/http-client ChangeLog | ||
## 1.1.0 - 2021-04-06 | ||
### Changed | ||
- Updated `ky`, `ky-universal`, and `mocha` dependencies. | ||
## 1.0.0 - 2020-06-18 | ||
@@ -4,0 +9,0 @@ |
{ | ||
"name": "@digitalbazaar/http-client", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "An opinionated, isomorphic HTTP client.", | ||
@@ -23,4 +23,4 @@ "license": "BSD-3-Clause", | ||
"esm": "^3.2.22", | ||
"ky": "^0.20.0", | ||
"ky-universal": "^0.7.0" | ||
"ky": "^0.25.1", | ||
"ky-universal": "^0.8.2" | ||
}, | ||
@@ -46,3 +46,3 @@ "devDependencies": { | ||
"karma-webpack": "^4.0.2", | ||
"mocha": "^7.2.0", | ||
"mocha": "^8.3.2", | ||
"nyc": "^15.1.0", | ||
@@ -49,0 +49,0 @@ "webpack": "^4.43.0" |
@@ -28,3 +28,3 @@ # http-client | ||
// use an agent to avoid self-signed certificate errors | ||
const agent = new https.agent({rejectUnauthorized: false}); | ||
const agent = new https.Agent({rejectUnauthorized: false}); | ||
try { | ||
@@ -60,2 +60,3 @@ result = await httpClient.get('http://httpbin.org/json', {agent}); | ||
result = await httpClient.post('http://httpbin.org/json', { | ||
// `json` is the payload or body of the POST request | ||
json: {some: 'data'} | ||
@@ -71,1 +72,21 @@ }); | ||
``` | ||
#### POST a JSON payload in Node with a HTTP Agent | ||
```js | ||
import https from 'https'; | ||
// use an agent to avoid self-signed certificate errors | ||
const agent = new https.Agent({rejectUnauthorized: false}); | ||
try { | ||
result = await httpClient.post('http://httpbin.org/json', { | ||
agent, | ||
// `json` is the payload or body of the POST request | ||
json: {some: 'data'} | ||
}); | ||
return result.data; | ||
} catch(e) { | ||
// status is HTTP status code | ||
// data is JSON error from the server | ||
const {data, status} = e; | ||
throw e; | ||
} | ||
``` |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
8157
90
1
+ Addeddata-uri-to-buffer@3.0.1(transitive)
+ Addedfetch-blob@2.1.2(transitive)
+ Addedky@0.25.1(transitive)
+ Addedky-universal@0.8.2(transitive)
+ Addednode-fetch@3.0.0-beta.9(transitive)
- Removeddata-uri-to-buffer@4.0.1(transitive)
- Removedfetch-blob@3.2.0(transitive)
- Removedformdata-polyfill@4.0.10(transitive)
- Removedky@0.20.0(transitive)
- Removedky-universal@0.7.0(transitive)
- Removednode-domexception@1.0.0(transitive)
- Removednode-fetch@3.3.2(transitive)
- Removedweb-streams-polyfill@3.3.3(transitive)
Updatedky@^0.25.1
Updatedky-universal@^0.8.2