mirror of
https://github.com/usebruno/bruno.git
synced 2025-07-19 05:23:40 +02:00
51 lines
739 B
JavaScript
51 lines
739 B
JavaScript
class BrunoRequest {
|
|
constructor(req) {
|
|
this.req = req;
|
|
this.url = req.url;
|
|
this.method = req.method;
|
|
this.headers = req.headers;
|
|
this.body = req.data;
|
|
}
|
|
|
|
getUrl() {
|
|
return this.req.url;
|
|
}
|
|
|
|
setUrl(url) {
|
|
this.req.url = url;
|
|
}
|
|
|
|
getMethod() {
|
|
return this.req.method;
|
|
}
|
|
|
|
setMethod(method) {
|
|
this.req.method = method;
|
|
}
|
|
|
|
getHeaders() {
|
|
return this.req.headers;
|
|
}
|
|
|
|
setHeaders(headers) {
|
|
this.req.headers = headers;
|
|
}
|
|
|
|
getHeader(name) {
|
|
return this.req.headers[name];
|
|
}
|
|
|
|
setHeader(name, value) {
|
|
this.req.headers[name] = value;
|
|
}
|
|
|
|
getBody() {
|
|
return this.req.data;
|
|
}
|
|
|
|
setBody(data) {
|
|
this.req.data = data;
|
|
}
|
|
}
|
|
|
|
module.exports = BrunoRequest; |