mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-07-16 21:33:57 +02:00
Upload main code
This commit is contained in:
14
model/WumpResponse.js
Normal file
14
model/WumpResponse.js
Normal file
@@ -0,0 +1,14 @@
|
||||
module.exports = class WumpResponse {
|
||||
constructor ( res ) {
|
||||
this.body = Buffer.alloc( 0 );
|
||||
this.coreRes = res
|
||||
|
||||
this.headers = res.headers;
|
||||
this.statusCode = res.statusCode;
|
||||
}
|
||||
|
||||
_addChunk ( chunk ) { this.body = Buffer.concat([ this.body, chunk ]); }
|
||||
|
||||
text () { return this.body.toString(); }
|
||||
json () { return JSON.parse( this.body ); }
|
||||
}
|
||||
Reference in New Issue
Block a user