forked from YounGoat/nodejs.htp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
44 lines (33 loc) · 843 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
44
'use strict';
const MODULE_REQUIRE = 1
/* built-in */
, fs = require('fs')
, stream = require('stream')
/* NPM */
/* in-package */
, htp = require('htp')
;
// var rs = new stream.Readable({
// read: function() {
// }
// });
// rs.on('data', function(data) {
// console.log(data);
// });
// var rs = fs.createReadStream('/Users/jiangjing/JPO/WorkingSpace/Java/JavaExercise/target/classes/car.jpg');
// htp.put('http://localhost:8080/', rs, function(err, entity) {
// console.log('out', err);
// console.log('out', entity);
// });
//
// rs.push('hello');
// rs.push('hello');
// rs.push('hello');
// rs.push('hello');
//
// rs.push(null);
htp.get('http://www.baidu.com/', function(err, entity) {
console.log('ERROR', err);
console.log('ENTITY', Object.keys(entity));
console.log('performance', entity.performance);
});