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