aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests/requests.ts
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/requests/requests.ts')
-rw-r--r--shared/extra-utils/requests/requests.ts9
1 files changed, 7 insertions, 2 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index eb59ca600..8c26a3699 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -182,10 +182,14 @@ function decodeQueryString (path: string) {
182 return decode(path.split('?')[1]) 182 return decode(path.split('?')[1])
183} 183}
184 184
185function unwrap <T> (test: request.Test): Promise<T> { 185function unwrapBody <T> (test: request.Test): Promise<T> {
186 return test.then(res => res.body) 186 return test.then(res => res.body)
187} 187}
188 188
189function unwrapText (test: request.Test): Promise<string> {
190 return test.then(res => res.text)
191}
192
189// --------------------------------------------------------------------------- 193// ---------------------------------------------------------------------------
190 194
191export { 195export {
@@ -198,6 +202,7 @@ export {
198 makePutBodyRequest, 202 makePutBodyRequest,
199 makeDeleteRequest, 203 makeDeleteRequest,
200 makeRawRequest, 204 makeRawRequest,
201 unwrap, 205 unwrapBody,
206 unwrapText,
202 updateImageRequest 207 updateImageRequest
203} 208}