diff --git a/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts b/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts index 83d3fdfde6..1bc0481508 100644 --- a/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts +++ b/packages/nodes-base/nodes/HttpRequest/V3/HttpRequestV3.node.ts @@ -1109,19 +1109,23 @@ export class HttpRequestV3 implements INodeType { ); } else if (specifyBody === 'json') { // body is specified using JSON - try { - JSON.parse(jsonBodyParameter); - } catch (_) { - throw new NodeOperationError( - this.getNode(), - 'JSON parameter need to be an valid JSON', - { - runIndex: itemIndex, - }, - ); - } + if (typeof jsonBodyParameter !== 'object' && jsonBodyParameter !== null) { + try { + JSON.parse(jsonBodyParameter); + } catch (_) { + throw new NodeOperationError( + this.getNode(), + 'JSON parameter need to be an valid JSON', + { + runIndex: itemIndex, + }, + ); + } - requestOptions.body = jsonParse(jsonBodyParameter); + requestOptions.body = jsonParse(jsonBodyParameter); + } else { + requestOptions.body = jsonBodyParameter; + } } else if (specifyBody === 'string') { //form urlencoded requestOptions.body = Object.fromEntries(new URLSearchParams(body));