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