Permalink
Browse files

Merge pull request #20 from alexindigo/master

Updated Readme and version number.
  • Loading branch information...
alexindigo committed Dec 5, 2012
2 parents f180a85 + 0bd8423 commit 7e98fb9de70ef0273bd8251baa6ad9bfc40d2a38
Showing with 20 additions and 1 deletion.
  1. +19 −0 Readme.md
  2. +1 −1 package.json
View
@@ -83,4 +83,23 @@ form.submit('example.org/upload', function(err, res) {
});
```
+To use custom headers and pre-known length in parts:
+
+``` javascript
+var CRLF = '\r\n';
+var form = new FormData();
+
+var options = {
+ header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,
+ knownLength: 1
+};
+
+form.append('my_buffer', buffer, options);
+
+form.submit('http://example.com/', function(err, res) {
+ if (err) throw err;
+ console.log('Done');
+});
+```
+
[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface
View
@@ -2,7 +2,7 @@
"author": "Felix Geisendörfer <felix@debuggable.com> (http://debuggable.com/)",
"name": "form-data",
"description": "A module to create readable `\"multipart/form-data\"` streams. Can be used to submit forms and file uploads to other web applications.",
- "version": "0.0.4",
+ "version": "0.0.5",
"repository": {
"type": "git",
"url": "git://github.com/felixge/node-form-data.git"

0 comments on commit 7e98fb9

Please sign in to comment.