2023-01-29 00:19:31 +01:00
|
|
|
class BrunoResponse {
|
2023-02-06 21:42:23 +01:00
|
|
|
constructor(res) {
|
|
|
|
this.res = res;
|
2023-08-30 18:05:59 +02:00
|
|
|
this.status = res ? res.status : null;
|
|
|
|
this.statusText = res ? res.statusText : null;
|
|
|
|
this.headers = res ? res.headers : null;
|
|
|
|
this.body = res ? res.data : null;
|
2023-01-29 00:19:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getStatus() {
|
2023-08-30 18:05:59 +02:00
|
|
|
return this.res ? this.res.status : null;
|
2023-01-29 00:19:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getHeader(name) {
|
2023-09-21 21:12:14 +02:00
|
|
|
return this.res && this.res.headers ? this.res.headers[name] : null;
|
2023-01-29 00:19:31 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
getHeaders() {
|
2023-08-30 18:05:59 +02:00
|
|
|
return this.res ? this.res.headers : null;
|
2023-01-29 00:19:31 +01:00
|
|
|
}
|
|
|
|
|
2023-02-06 18:30:50 +01:00
|
|
|
getBody() {
|
2023-08-30 18:05:59 +02:00
|
|
|
return this.res ? this.res.data : null;
|
2023-01-29 00:19:31 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = BrunoResponse;
|