Skip to content

Commit

Permalink
bug fix httpconsumer
Browse files Browse the repository at this point in the history
  • Loading branch information
simon louvet committed May 13, 2024
1 parent cd2588b commit be40b6b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions engine/workspaceComponentExecutor/httpConsumer.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,14 @@ class HttpConsumer {


let body;
let bodyObject = flowData[0].data;
if (componentConfig.bodyPath && componentConfig.bodyPath.length>0){
bodyObject = dotProp.get(bodyObject, componentConfig.bodyPath)
}


if(componentConfig.noBody!=true && flowData){
// console.log("here ",flowData[0].data);
let bodyObject = flowData[0].data;
if (componentConfig.bodyPath && componentConfig.bodyPath.length>0){
bodyObject = dotProp.get(bodyObject, componentConfig.bodyPath)
}

console.log("bodyObject",bodyObject);
switch (componentConfig.contentType) {
case 'text/plain':
body = bodyObject.toString();
Expand All @@ -119,7 +119,7 @@ class HttpConsumer {
reject(new Error(`${componentConfig.contentType} contentType not Supported by this component`));

}
// console.log('body',body);
console.log('body1',body);
}

let url=componentConfig.url;
Expand All @@ -130,6 +130,7 @@ class HttpConsumer {

let response;
let errorMessage;
console.log('body2',body);
if(componentConfig.contentType && body){
headers['Content-Type']=componentConfig.contentType
}
Expand All @@ -154,7 +155,7 @@ class HttpConsumer {
rejectUnauthorized: false
}
}

console.log(url, options)
this.call_url(url, options,
undefined,
componentConfig.timeout,
Expand Down

0 comments on commit be40b6b

Please sign in to comment.