For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Postman
PricingEnterprise
Contact SalesSign InSign Up for Free
HomeDocs
HomeDocs
      • Overview
        • Overview
          • Overview
          • Rename headers
          • Detect session cookie
          • Route response data
        • Deployed flows overview
        • Connector blocks overview
Postman API Platform

Product

  • Postman Overview
  • Enterprise
  • Spec Hub
  • Flows
  • Agent Mode
  • API Catalog
  • Fern
  • Postman CLI
  • Integrations
  • Workspaces
  • Plans and pricing

API Network

  • App Security
  • Artificial Intelligence
  • Communication
  • Data Analytics
  • Database
  • Developer Productivity
  • DevOps
  • Ecommerce
  • eSignature
  • Financial Services
  • Payments
  • Travel

Resources

  • Postman Docs
  • Academy
  • Community
  • Templates
  • Intergalactic
  • Videos
  • MCP Servers

Legal and Security

  • Legal Terms Hub
  • Terms of Service
  • Postman Product Terms
  • Security
  • Website Terms of Use

Company

  • About
  • Careers and culture
  • Contact us
  • Partner program
  • Customer stories
  • Student programs
  • Press and media
Twitter iconLinkedIn iconGithub iconYouTube iconInstagram iconDiscord icon
Download Postman
Privacy Policy

© 2026 Postman, Inc.

On this page
  • Example JSON
  • Rename headers with camel case
  • Example
Postman FlowsFlows referenceTypeScript in flows

Rename headers with TypeScript in Flows

||View as Markdown|
Was this page helpful?
Previous

Use TypeScript in Postman Flows

Next

Detect a session id cookie with TypeScript in Flows

Built with

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:

1{
2 "body": {
3 "args": {},
4 "headers": {
5 "host": "postman-echo.com",
6 "x-request-start": "t1757972551.591",
7 "connection": "close",
8 "x-forwarded-proto": "https",
9 "x-forwarded-port": "443",
10 "x-amzn-trace-id": "Root=1-68c88847-aaaaaaaaaaaaaaaaaaaaaaaa",
11 "user-agent": "PostmanRuntime/7.46.0",
12 "accept": "*/*",
13 "cache-control": "no-cache",
14 "postman-token": "00000000-1111-2222-3333-444444444444",
15 "accept-encoding": "gzip, deflate, br",
16 "cookie": "sails.sid=s%3AdummySessionId1234567890.abcdef1234567890"
17 },
18 "url": "https://postman-echo.com/get"
19 },
20 "http": {
21 "status": 200,
22 "headers": {
23 "Date": "Mon, 15 Sep 2025 21:42:31 GMT",
24 "Content-Type": "application/json; charset=utf-8",
25 "Content-Length": "621",
26 "Connection": "keep-alive",
27 "Server": "nginx",
28 "ETag": "W/"26d-FAKEETAG1234567890"",
29 "Set-Cookie": "sails.sid=s%3AdummySetCookieId0987654321.qwerty9876543210; Path=/; HttpOnly"
30 }
31 },
32 "tests": [],
33 "binary": false
34}

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.

1const headers = response.http?.headers ?? {};
2
3const normalized = {
4 contentType: response.http.headers["Content-Type"],
5 contentLength: response.http.headers["Content-Length"]
6};
7
8normalized

Example

To see this TypeScript in an example flow, check out TypeScript example 1: Rename headers with camel case.