summaryrefslogtreecommitdiff
path: root/packages/taler-wallet-core/src/headless/NodeHttpLib.ts
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
committerFlorian Dold <florian.dold@gmail.com>2020-08-06 00:30:36 +0530
commit82a2437c0967871d6b942105c98c3382978cad29 (patch)
treeda803c3d4a58d9c691f5908b379791c8ee55cc37 /packages/taler-wallet-core/src/headless/NodeHttpLib.ts
parenta8f03d3dd1ad04abf7f569cb44933b6dce6713e7 (diff)
downloadwallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.gz
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.tar.bz2
wallet-core-82a2437c0967871d6b942105c98c3382978cad29.zip
towards integration tests with fault injection
Diffstat (limited to 'packages/taler-wallet-core/src/headless/NodeHttpLib.ts')
-rw-r--r--packages/taler-wallet-core/src/headless/NodeHttpLib.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/taler-wallet-core/src/headless/NodeHttpLib.ts b/packages/taler-wallet-core/src/headless/NodeHttpLib.ts
index d109c3b7c..59730ab30 100644
--- a/packages/taler-wallet-core/src/headless/NodeHttpLib.ts
+++ b/packages/taler-wallet-core/src/headless/NodeHttpLib.ts
@@ -45,7 +45,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
}
private async req(
- method: "post" | "get",
+ method: "POST" | "GET",
url: string,
body: any,
opt?: HttpRequestOptions,
@@ -72,6 +72,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
{
httpStatusCode: resp.status,
requestUrl: url,
+ requestMethod: method,
},
),
);
@@ -88,6 +89,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
{
httpStatusCode: resp.status,
requestUrl: url,
+ requestMethod: method,
},
),
);
@@ -100,6 +102,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
{
httpStatusCode: resp.status,
requestUrl: url,
+ requestMethod: method,
},
),
);
@@ -112,6 +115,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
}
return {
requestUrl: url,
+ requestMethod: method,
headers,
status: resp.status,
text: async () => resp.data,
@@ -120,7 +124,7 @@ export class NodeHttpLib implements HttpRequestLibrary {
}
async get(url: string, opt?: HttpRequestOptions): Promise<HttpResponse> {
- return this.req("get", url, undefined, opt);
+ return this.req("GET", url, undefined, opt);
}
async postJson(
@@ -128,6 +132,6 @@ export class NodeHttpLib implements HttpRequestLibrary {
body: any,
opt?: HttpRequestOptions,
): Promise<HttpResponse> {
- return this.req("post", url, body, opt);
+ return this.req("POST", url, body, opt);
}
}