Skip to content

Commit 77a024a

Browse files
author
Adrian Punga
committed
Documented custom headers option
1 parent bd50685 commit 77a024a

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Readme.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,18 @@ form.submit({
149149
});
150150
```
151151

152+
In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:
153+
154+
``` javascript
155+
form.submit({
156+
host: 'example.com',
157+
path: '/surelynot.php',
158+
headers: {'x-test-header': 'test-header-value'}
159+
}, function(err, res) {
160+
console.log(res.statusCode);
161+
});
162+
```
163+
152164
## Notes
153165

154166
- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.

0 commit comments

Comments
 (0)