From 435bcf646815123247b2e06142052ed1ba2e3fbb Mon Sep 17 00:00:00 2001 From: "Benedict John P. Torres" Date: Thu, 30 Nov 2023 23:21:27 +0800 Subject: [PATCH] feat: httpRequest to add HEAD method (#4574) * httpRequest to add HEAD method * 4574 - feat HEAD request resolving feedback and running test actions --- .../etc/botbuilder-dialogs-adaptive.api.md | 1 + .../schemas/Actions/Microsoft.HttpRequest.schema | 3 ++- .../botbuilder-dialogs-adaptive/src/actions/httpRequest.ts | 6 ++++++ libraries/tests.schema | 3 ++- libraries/tests.uischema | 3 ++- 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/libraries/botbuilder-dialogs-adaptive/etc/botbuilder-dialogs-adaptive.api.md b/libraries/botbuilder-dialogs-adaptive/etc/botbuilder-dialogs-adaptive.api.md index 38d4cb7a57..ae1372d70b 100644 --- a/libraries/botbuilder-dialogs-adaptive/etc/botbuilder-dialogs-adaptive.api.md +++ b/libraries/botbuilder-dialogs-adaptive/etc/botbuilder-dialogs-adaptive.api.md @@ -1183,6 +1183,7 @@ export class HasPendingActionsFunction extends ExpressionEvaluator { export enum HttpMethod { DELETE = "DELETE", GET = "GET", + HEAD = "HEAD", PATCH = "PATCH", POST = "POST", PUT = "PUT" diff --git a/libraries/botbuilder-dialogs-adaptive/schemas/Actions/Microsoft.HttpRequest.schema b/libraries/botbuilder-dialogs-adaptive/schemas/Actions/Microsoft.HttpRequest.schema index 33bbbdc765..720a2ae85d 100644 --- a/libraries/botbuilder-dialogs-adaptive/schemas/Actions/Microsoft.HttpRequest.schema +++ b/libraries/botbuilder-dialogs-adaptive/schemas/Actions/Microsoft.HttpRequest.schema @@ -31,7 +31,8 @@ "POST", "PATCH", "PUT", - "DELETE" + "DELETE", + "HEAD" ], "examples": [ "GET", diff --git a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts index d570e8b5f6..128cbc9e93 100644 --- a/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts +++ b/libraries/botbuilder-dialogs-adaptive/src/actions/httpRequest.ts @@ -107,6 +107,11 @@ export enum HttpMethod { * Http DELETE */ DELETE = 'DELETE', + + /** + * Http HEAD + */ + HEAD = 'HEAD', } /** @@ -313,6 +318,7 @@ export class HttpRequest extends Dialog implements Htt switch (this.method) { case HttpMethod.DELETE: case HttpMethod.GET: + case HttpMethod.HEAD: response = await fetch(instanceUrl, { method: instanceMethod, headers: instanceHeaders, diff --git a/libraries/tests.schema b/libraries/tests.schema index 19bd90e5d0..53c20ad7a0 100644 --- a/libraries/tests.schema +++ b/libraries/tests.schema @@ -3801,7 +3801,8 @@ "POST", "PATCH", "PUT", - "DELETE" + "DELETE", + "HEAD" ], "examples": [ "GET", diff --git a/libraries/tests.uischema b/libraries/tests.uischema index 54655146ff..9d11eb27e8 100644 --- a/libraries/tests.uischema +++ b/libraries/tests.uischema @@ -8,7 +8,8 @@ "triggers", "generator", "selector", - "schema" + "schema", + "dialogs" ], "label": "Adaptive dialog", "order": [