File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,35 @@ form.append('my_buffer', new Buffer(10));
2727form .append (' my_file' , fs .createReadStream (' /foo/bar.jpg' ));
2828```
2929
30+ Also you can use http-response stream:
31+
32+ ``` javascript
33+ var FormData = require (' form-data' );
34+ var http = require (' http' );
35+
36+ var form = new FormData ();
37+
38+ http .request (' http://nodejs.org/images/logo.png' , function (response )
39+ {
40+ form .append (' my_field' , ' my value' );
41+ form .append (' my_buffer' , new Buffer (10 ));
42+ form .append (' my_logo' , response);
43+ });
44+ ```
45+
46+ Or @mikeal 's request stream:
47+
48+ ``` javascript
49+ var FormData = require (' form-data' );
50+ var request = require (' request' );
51+
52+ var form = new FormData ();
53+
54+ form .append (' my_field' , ' my value' );
55+ form .append (' my_buffer' , new Buffer (10 ));
56+ form .append (' my_logo' , request (' http://nodejs.org/images/logo.png' ));
57+ ```
58+
3059In order to submit this form to a web application, you can use node's http
3160client interface:
3261
You can’t perform that action at this time.
0 commit comments