diff --git a/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts b/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts index 92cd8d6..486ba5b 100644 --- a/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts +++ b/FlowPluginsTs/CommunityFlowPlugins/tools/webRequest/1.0.0/index.ts @@ -74,6 +74,16 @@ const details = (): IpluginDetails => ({ }, tooltip: 'Specify request body', }, + { + label: 'Log Response Body', + name: 'logResponseBody', + type: 'boolean', + defaultValue: 'false', + inputUI: { + type: 'switch', + }, + tooltip: 'Specify whether to log response body in the job report', + }, ], outputs: [ { @@ -93,6 +103,7 @@ const plugin = async (args: IpluginInputArgs): Promise => { const requestUrl = String(args.inputs.requestUrl); const requestHeaders = JSON.parse(String(args.inputs.requestHeaders)); const requestBody = JSON.parse(String(args.inputs.requestBody)); + const { logResponseBody } = args.inputs; const requestConfig = { method, @@ -104,6 +115,10 @@ const plugin = async (args: IpluginInputArgs): Promise => { try { const res = await args.deps.axios(requestConfig); args.jobLog(`Web request succeeded: Status Code: ${res.status}`); + + if (logResponseBody) { + args.jobLog(`Response Body: ${JSON.stringify(res.data)}`); + } } catch (err) { args.jobLog('Web Request Failed'); args.jobLog(JSON.stringify(err));