MCPcopy Create free account
hub / github.com/form-data/form-data / submitForm

Function submitForm

test/integration/test-submit-multi.js:14–37  ·  view source on GitHub ↗

* Test parallel submissions to the same server

()

Source from the content-addressed store, hash-verified

12 * Test parallel submissions to the same server
13 */
14function submitForm() {
15 var form = new FormData();
16
17 form.append('my_field', 'my_value');
18
19 form.submit('http://localhost:' + common.port + '/', function (err, res) {
20 if (err) {
21 throw err;
22 }
23
24 assert.strictEqual(res.statusCode, 200);
25
26 /*
27 * Needed for node-0.10.x because Streams2
28 * more info: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions
29 */
30 res.resume();
31
32 times -= 1;
33 if (times === 0) {
34 server.close();
35 }
36 });
37}
38
39server = http.createServer(function (req, res) {
40 // no need to have tmp dir here, since no files being uploaded

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected