Rename value to contents.
This commit is contained in:
parent
9c1cbb81c9
commit
b337b6d4fb
3 changed files with 9 additions and 14 deletions
|
@ -10,18 +10,12 @@
|
||||||
|
|
||||||
curl('127.0.0.1/upload.php', {
|
curl('127.0.0.1/upload.php', {
|
||||||
multipart: [
|
multipart: [
|
||||||
{
|
{name: 'file', file: '/home/miao/test.js', type: 'text/html'},
|
||||||
name: 'file',
|
{name: 'sumbit', value: 'send'}
|
||||||
file: '/home/miao/test.js',
|
|
||||||
type: 'text/html'
|
|
||||||
}, {
|
|
||||||
name: 'sumbit',
|
|
||||||
value: 'send'
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
}, function(e) {
|
}, function(e) {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
return console.log(curl.body);
|
console.log(curl.body);
|
||||||
});
|
});
|
||||||
|
|
||||||
}).call(this);
|
}).call(this);
|
||||||
|
|
|
@ -5,8 +5,9 @@ p 'start'
|
||||||
curl '127.0.0.1/upload.php', {
|
curl '127.0.0.1/upload.php', {
|
||||||
multipart: [
|
multipart: [
|
||||||
{name: 'file', file: '/home/miao/test.js', type: 'text/html'},
|
{name: 'file', file: '/home/miao/test.js', type: 'text/html'},
|
||||||
{name: 'sumbit', value: 'send'}
|
{name: 'sumbit', contents: 'send'}
|
||||||
],
|
],
|
||||||
}, (e) ->
|
}, (e) ->
|
||||||
console.log e
|
console.log e
|
||||||
console.log curl.body
|
console.log @body
|
||||||
|
@close()
|
||||||
|
|
|
@ -59,7 +59,7 @@ class NodeCurlHttppost
|
||||||
enum {
|
enum {
|
||||||
NAME,
|
NAME,
|
||||||
FILE,
|
FILE,
|
||||||
VALUE,
|
CONTENTS,
|
||||||
TYPE
|
TYPE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ class NodeCurlHttppost
|
||||||
case FILE:
|
case FILE:
|
||||||
value = strndup(value, length);
|
value = strndup(value, length);
|
||||||
last->flags |= HTTPPOST_FILENAME;
|
last->flags |= HTTPPOST_FILENAME;
|
||||||
case VALUE:
|
case CONTENTS:
|
||||||
last->contents = value;
|
last->contents = value;
|
||||||
last->contentslength = length;
|
last->contentslength = length;
|
||||||
break;
|
break;
|
||||||
|
@ -541,7 +541,7 @@ class NodeCurl
|
||||||
CurlOption httppost_options[] = {
|
CurlOption httppost_options[] = {
|
||||||
X(NAME),
|
X(NAME),
|
||||||
X(FILE),
|
X(FILE),
|
||||||
X(VALUE),
|
X(CONTENTS),
|
||||||
X(TYPE)
|
X(TYPE)
|
||||||
};
|
};
|
||||||
#undef X
|
#undef X
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue