The setLogBodyContentTypes()
function allows capturing the response body for specific content types in API analytics.
Compatibility
Requires Node.js agent version 1.6.3 or higher.
Syntax
atatus.setLogBodyContentTypes(contentType)
Parameter
Parameter | Type | Description |
---|---|---|
contentType | String or String[] (Required) | Content Types. |
Example
copy
import atatus from "atatus-nodejs";
// By default, agent allows two content types: application/json, text/plain
// You can add extra content type as below
atatus.setLogBodyContentTypes("text/xml");
// (OR)
// You can reset default content type array as follows
atatus.setLogBodyContentTypes(["text/xml", "application/json", "text/plain"]);