-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathtest.js
43 lines (33 loc) · 900 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
var http = require('http');
/* user request
var options = {
host: 'localhost',
port: 3002,
path: '/user/find/[email protected]',
method: 'GET',
};
var soa_req = http.request(options, function(soa_res) {
console.log('STATUS: ' + soa_res.statusCode);
console.log('HEADERS: ' + JSON.stringify(soa_res.headers));
//soa_res.setEncoding('utf8');
soa_res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
soa_req.end();
*/
var options = {
host: 'localhost',
port: 3002,
path: '/file/import/',
method: 'POST',
};
var soa_req = http.request(options, function(soa_res) {
console.log('STATUS: ' + soa_res.statusCode);
console.log('HEADERS: ' + JSON.stringify(soa_res.headers));
//soa_res.setEncoding('utf8');
soa_res.on('data', function (chunk) {
console.log('BODY: ' + chunk);
});
});
soa_req.write('/tmp/testfile');