An Azure service that provides an event-driven serverless compute platform.
Hi @braxx
I believe html is the object that you have defined in your function and I see that you have not used JSON.stringify to convert it to json object.
fetch("https://prod-30.eastus2.logic.azure.com:443/workflows/123axc/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=abc123-XKP-fPs",{method: "POST", body: {"html": html}, headers: {
"Content-Type": "application/json",
}})
I have tested the scenario at my end and it is working as expected. I will also suggest you to verify whether you have selected "POST" method in the drop down of "When a HTTP request is received" trigger which would cause this issue.
let data = {
userId: 123,
title: "loren impsum doloris",
completed: false
};
fetch("https://prod-29.westus.logic.azure.com:443/workflows/yourworkflow/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=_tPma_SSYXNpIe9Eh96Zb_7uoDw0fyfoDofxyJrCBqw", {
method: "POST",
body: JSON.stringify(data),
headers: { "Content-Type": "application/json"}
})
You can refer to node-fetch document for more details. You will only see the error/exception if the fetch statement throws the exception. If I pass the wrong syntax in fetch statement then it throws the exception but if I do not convert the object to json then it doesn't throw any exception as you have observed.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.