Socket
Socket
Sign inDemoInstall

request-json

Package Overview
Dependencies
Maintainers
1
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-json - npm Package Compare versions

Comparing version 0.4.8 to 0.4.9

38

main.js
// Generated by CoffeeScript 1.7.1
(function() {
var fs, parseBody, request, url;
var clone, fs, parseBody, request, url;

@@ -11,2 +11,11 @@ request = require("request");

clone = function(obj) {
var key, result;
result = {};
for (key in obj) {
result[key] = obj[key];
}
return result;
};
parseBody = function(error, response, body, callback) {

@@ -63,3 +72,3 @@ var err, parsed;

}
options = this.options;
options = clone(this.options);
options.method = 'GET';

@@ -82,3 +91,3 @@ options.uri = url.resolve(this.host, path);

}
options = this.options;
options = clone(this.options);
options.method = "POST";

@@ -102,3 +111,3 @@ options.uri = url.resolve(this.host, path);

}
options = this.options;
options = clone(this.options);
options.method = "PUT";

@@ -117,2 +126,21 @@ options.uri = url.resolve(this.host, path);

JsonClient.prototype.patch = function(path, json, callback, parse) {
var options;
if (parse == null) {
parse = true;
}
options = clone(this.options);
options.method = "PATCH";
options.uri = url.resolve(this.host, path);
options.json = json;
options.headers = this.headers;
return request(options, function(error, response, body) {
if (parse) {
return parseBody(error, response, body, callback);
} else {
return callback(error, response, body);
}
});
};
JsonClient.prototype.del = function(path, callback, parse) {

@@ -123,3 +151,3 @@ var options;

}
options = this.options;
options = clone(this.options);
options.method = "DELETE";

@@ -126,0 +154,0 @@ options.uri = url.resolve(this.host, path);

3

package.json

@@ -18,3 +18,3 @@ {

],
"version": "0.4.8",
"version": "0.4.9",
"homepage": "https://github.com/mycozycloud/request-json/",

@@ -30,2 +30,3 @@ "bugs": {

"Frank Rousseau",
"Alan Plum",
"Fábio Santos",

@@ -32,0 +33,0 @@ "Stephen Tweeddale",

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