zoho-delugecatalystbyzohozohocatalystcatalystserverless

Getting Empty Body when sending Data to Catalyst From Deluge


I am trying to hit my Catalyst Functions API from Deluge using the below code snippet:

inputdata = map();
inputdata.put("Key","value");

app_response = invokeurl 
[ 
url :"my_catalyst_function_url" 
type :POST 
parameters: inputdata.toString() 
]; 
info app_response;
return "";

But I keep getting empty body from the API request. Can someone help me resolve this?


Solution

  • The API request you are sending from Deluge might not be in the expected application/json format. I am guessing you might be trying to retrive the request body based on the JSON format which might be the cause for you getting empty response.

    You can try adding the line content-type:"application/json" inisde your invoke_url function send the request body in application/json format.

    inputdata = map();
    inputdata.put("Key","value");
    
    app_response = invokeurl 
    [ 
    url :"my_catalyst_function_url" 
    type :POST 
    content-type:"application/json"
    parameters: inputdata.toString() 
    ]; 
    info app_response;
    return "";