Socket
Socket
Sign inDemoInstall

httpie

Package Overview
Dependencies
0
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1 to 1.1.2

22

dist/httpie.js

@@ -5,2 +5,11 @@ const { request } = require('https');

function toError(rej, res, err) {
err = err || new Error(res.statusMessage);
err.statusMessage = res.statusMessage;
err.statusCode = res.statusCode;
err.headers = res.headers;
err.data = res.data;
rej(err);
}
function send(method, uri, opts={}) {

@@ -25,12 +34,11 @@ return new Promise((res, rej) => {

if (type && out && type.includes('application/json')) {
out = JSON.parse(out, opts.reviver);
try {
out = JSON.parse(out, opts.reviver);
} catch (err) {
return toError(rej, r, err);
}
}
r.data = out;
if (r.statusCode >= 400) {
let err = new Error(r.statusMessage);
err.statusMessage = r.statusMessage;
err.statusCode = r.statusCode;
err.headers = r.headers;
err.data = r.data;
rej(err);
toError(rej, r);
} else if (r.statusCode > 300 && redirect && r.headers.location) {

@@ -37,0 +45,0 @@ opts.path = resolve(opts.path, r.headers.location);

{
"name": "httpie",
"version": "1.1.1",
"version": "1.1.2",
"repository": "lukeed/httpie",

@@ -5,0 +5,0 @@ "description": "A lightweight, Promise-based wrapper for Node.js HTTP requests~!",

@@ -27,3 +27,3 @@ <div align="center">

* Automatically handles JSON requests and responses
* Extremely lightweight with **no dependencies** – 649 bytes!
* Extremely lightweight with **no dependencies** 678 bytes!
* Includes aliases for common HTTP verbs: `get`, `post`, `put`, `patch`, and `del`

@@ -30,0 +30,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc