Is this correct way when I don't want to log the file data using the given condition, that the contentType is application/json or any other way is there to skip writing the file contents?
if (context.Response.ContentType.Contains("application/json"))
{
logger(responseBody);
}
if (!context.Request.ContentType.Contains("application/json"))
{
logger(requestBody);
}