Permalink
Browse files

Merge git://github.com/c4milo/restler

  • Loading branch information...
2 parents 9a4f194 + 4c6cd33 commit ecbe627051770e4f8565544b482dbc487bc55c8c @ayoung ayoung committed Jan 6, 2012
Showing with 7 additions and 6 deletions.
  1. +1 −1 README.md
  2. +6 −5 lib/multipartform.js
View
@@ -118,7 +118,7 @@ Example usage
password: 'wouldntyouliketoknow',
data: {
'sound[message]': 'hello from restler!',
- 'sound[file]': rest.file('doug-e-fresh_the-show.mp3', 'audio/mpeg')
+ 'sound[file]': rest.file('doug-e-fresh_the-show.mp3', null, null, null, 'audio/mpeg')
}
}).on('complete', function(data) {
sys.puts(data.audio_url);
View
@@ -142,12 +142,13 @@ function MultiPartRequest(data, boundary) {
MultiPartRequest.prototype = {
_partNames: function() {
- partNames = []
- for (var name in this.data) {
- partNames.push(name)
+ var partNames = [];
+ for (var name in this.data) {
+ partNames.push(name)
}
return partNames;
},
+
write: function(stream, callback) {
var partCount = 0, self = this;
@@ -157,8 +158,8 @@ MultiPartRequest.prototype = {
// Let each part write itself out to the stream
(function writePart() {
- partName = this.partNames[partCount];
- part = new Part(partName, self.data[partName], self.boundary);
+ var partName = self.partNames[partCount];
+ var part = new Part(partName, self.data[partName], self.boundary);
part.write(stream, function (err) {
if (err) {
callback(err);

0 comments on commit ecbe627

Please sign in to comment.