BotanSS/net/events/HttpRequestComplete.js

37 lines
542 B
JavaScript
Raw Normal View History

2016-06-16 07:16:29 +00:00
"use strict";
var EventArgs = require( "./EventArgs" );
class HttpRequestComplete extends EventArgs
{
constructor( Response, ResponseData )
{
super();
if( ResponseData === undefined )
{
this.statusCode = -1;
this.Data = Buffer.alloc( 0 );
2016-06-16 07:16:29 +00:00
}
else
{
this.statusCode = Response.statusCode;
this.Data = ResponseData;
}
this.Response = Response;
}
get Headers()
{
return this.Response.headers;
}
get ResponseString()
{
return this.Data.toString( "utf-8" );
}
}
module.exports = HttpRequestComplete;