0
const df = require("durable-functions");

module.exports = async function (context, req) {
    const client = df.getClient(context);
    
    context.log(`Function Name = '${req.params.functionName}'.`);
    context.log(`Body = '${req.body}'.`);
    const instanceId = await client.startNew(req.params.functionName, undefined, req.body);

    context.log(`Started orchestration with ID = '${instanceId}'.`);

    return client.createCheckStatusResponse(context.bindingData.req, instanceId);
};

I have tried to use POSTMAN or https://reqbin.com/ for testing but I always get object. It is a simple case but I don't understand why it is not JSON object.

Log example

Postman example

I read this one TypeScript Azure Function Read Body of POST method as JSON but it didn't help me.

1 Answers1

0

Everything is fine! It is already deserialized json object. It looks like the normal string in a log after

JSON.stringify(req.body)

My fault was that I wrongly got it in the orchestrator function from the context.