mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-07 14:18:47 +00:00
Add Transmission widget
- Update http.js to support writing request bodies - Update http.js to support returning all response headers resolves: #104
This commit is contained in:
parent
406358aae9
commit
b3db549a65
8 changed files with 148 additions and 4 deletions
|
@ -12,7 +12,7 @@ export function httpsRequest(url, params) {
|
|||
});
|
||||
|
||||
response.on("end", () => {
|
||||
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data)]);
|
||||
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data), response.headers]);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -20,6 +20,10 @@ export function httpsRequest(url, params) {
|
|||
reject([500, error]);
|
||||
});
|
||||
|
||||
if (params.body) {
|
||||
request.write(params.body);
|
||||
}
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
@ -34,7 +38,7 @@ export function httpRequest(url, params) {
|
|||
});
|
||||
|
||||
response.on("end", () => {
|
||||
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data)]);
|
||||
resolve([response.statusCode, response.headers["content-type"], Buffer.concat(data), response.headers]);
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -42,6 +46,10 @@ export function httpRequest(url, params) {
|
|||
reject([500, error]);
|
||||
});
|
||||
|
||||
if (params.body) {
|
||||
request.write(params.body);
|
||||
}
|
||||
|
||||
request.end();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue