Rename headers with TypeScript in Flows
This TypeScript example renames the Content-Type and Content-Length headers using camel case. Renaming headers can be useful for normalizing field names for testing purposes and mapping fields to different data models.
Example JSON
The example uses JSON data from a GET request to postman-echo.com like this:
Rename headers with camel case
The following TypeScript takes the headers from a response variable defined by the Evaluate block. It then maps the Content-Type and Content-Length headers to an object named normalized and renames them using camel case.
Example
To see this TypeScript in an example flow, check out TypeScript example 1: Rename headers with camel case.