request-json
Advanced tools
Comparing version 0.2.8 to 0.2.9
12
main.js
@@ -67,6 +67,14 @@ // Generated by CoffeeScript 1.3.3 | ||
JsonClient.prototype.sendFile = function(path, filePath, callback) { | ||
var form, req; | ||
JsonClient.prototype.sendFile = function(path, filePath, data, callback) { | ||
var att, form, req; | ||
if (typeof data === "function") { | ||
callback = data; | ||
} | ||
req = request.post("" + this.host + path, callback); | ||
form = req.form(); | ||
if (typeof data !== "function") { | ||
for (att in data) { | ||
form.append(att, data[att]); | ||
} | ||
} | ||
return form.append('file', fs.createReadStream(filePath)); | ||
@@ -73,0 +81,0 @@ }; |
@@ -16,3 +16,3 @@ { | ||
], | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"homepage": "https://github.com/mycozycloud/request-json/", | ||
@@ -19,0 +19,0 @@ "bugs": { |
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
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
5010
78