I want to retrieve data and format it before return to the user but don't know how to retrieve it, I see that the context only provides the request.
public class CustomResponse : IFunctionsWorkerMiddleware
{
public async Task Invoke(FunctionContext context, FunctionExecutionDelegate next)
{
try
{
await next(context);
if (!context.IsHttpTriggerFunction())
{
return;
}
/// format response here
} catch (Exception ex)
{
await context.CreateJsonResponse(System.Net.HttpStatusCode.InternalServerError, new
{
errorMessage = ex.Message
});
}
}
}
Does FunctionContext support us to get response data? If yes, how can i get it?