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;
|
2022-04-06 04:51:04 +00:00
|
|
|
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;
|