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

@digitalbazaar/http-client

Package Overview
Dependencies
Maintainers
6
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@digitalbazaar/http-client - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

5

CHANGELOG.md
# @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 @@

8

package.json
{
"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;
}
```
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