diff --git a/examples/post-multi-part.js b/examples/post-multi-part.js index 0a4ff5e..1232c65 100644 --- a/examples/post-multi-part.js +++ b/examples/post-multi-part.js @@ -10,18 +10,12 @@ curl('127.0.0.1/upload.php', { multipart: [ - { - name: 'file', - file: '/home/miao/test.js', - type: 'text/html' - }, { - name: 'sumbit', - value: 'send' - } + {name: 'file', file: '/home/miao/test.js', type: 'text/html'}, + {name: 'sumbit', value: 'send'} ] }, function(e) { console.log(e); - return console.log(curl.body); + console.log(curl.body); }); }).call(this); diff --git a/examples/post-multi-part.toffee b/examples/post-multi-part.toffee index 17e3746..33b339c 100644 --- a/examples/post-multi-part.toffee +++ b/examples/post-multi-part.toffee @@ -5,8 +5,9 @@ p 'start' curl '127.0.0.1/upload.php', { multipart: [ {name: 'file', file: '/home/miao/test.js', type: 'text/html'}, - {name: 'sumbit', value: 'send'} + {name: 'sumbit', contents: 'send'} ], }, (e) -> console.log e - console.log curl.body + console.log @body + @close() diff --git a/src/node-curl.h b/src/node-curl.h index 927eb71..5affdd8 100644 --- a/src/node-curl.h +++ b/src/node-curl.h @@ -59,7 +59,7 @@ class NodeCurlHttppost enum { NAME, FILE, - VALUE, + CONTENTS, TYPE }; @@ -78,7 +78,7 @@ class NodeCurlHttppost case FILE: value = strndup(value, length); last->flags |= HTTPPOST_FILENAME; - case VALUE: + case CONTENTS: last->contents = value; last->contentslength = length; break; @@ -541,7 +541,7 @@ class NodeCurl CurlOption httppost_options[] = { X(NAME), X(FILE), - X(VALUE), + X(CONTENTS), X(TYPE) }; #undef X