Fix #15, Support multipart post.
This commit is contained in:
parent
e318a72006
commit
9c1cbb81c9
10 changed files with 239 additions and 30 deletions
27
examples/post-multi-part.js
Normal file
27
examples/post-multi-part.js
Normal file
|
@ -0,0 +1,27 @@
|
|||
// Generated by ToffeeScript 1.6.2
|
||||
(function() {
|
||||
var curl, p;
|
||||
|
||||
curl = require('../index');
|
||||
|
||||
p = console.log;
|
||||
|
||||
p('start');
|
||||
|
||||
curl('127.0.0.1/upload.php', {
|
||||
multipart: [
|
||||
{
|
||||
name: 'file',
|
||||
file: '/home/miao/test.js',
|
||||
type: 'text/html'
|
||||
}, {
|
||||
name: 'sumbit',
|
||||
value: 'send'
|
||||
}
|
||||
]
|
||||
}, function(e) {
|
||||
console.log(e);
|
||||
return console.log(curl.body);
|
||||
});
|
||||
|
||||
}).call(this);
|
Loading…
Add table
Add a link
Reference in a new issue