---
name: "TSHttpHdrCopy"
section: "3ts"
platform: "linux"
package: "trafficserver-dev"
version: "9.2.5+ds-0+deb12u4"
release: "Debian 12 (Bookworm)"
platforms: ["linux"]
url: "https://new.carta.tech/TSHttpHdrCopy"
---

# TSHttpHdrCopy(3ts)

copies the contents of the HTTP header located at src\_loc within src\_bufp to the HTTP header located at dest\_loc within dest\_bufp

## NAME

TSHttpHdrCopy - copies the contents of the HTTP header located at src\_loc within src\_bufp to the HTTP header located at dest\_loc within dest\_bufp

## SYNOPSIS

```
#include <ts/ts.h>
```

- ***TSReturnCode* TSHttpHdrCopy(*TSMBuffer* dest\_bufp, *TSMLoc* dest\_offset, *TSMBuffer* src\_bufp, *TSMLoc* src\_offset)**

  ## DESCRIPTION

*TSHttpHdrCopy()* works correctly even if *src\_bufp* and *dest\_bufp* point to different *Marshal Buffers*. Make sure that you create the destination HTTP header before copying into it.

**NOTE:**

*TSHttpHdrCopy()* appends the port number to the domain of the URL portion of the header. For example, a copy of *http://www.example.com* appears as *http://www.example.com:80* in the destination buffer.

## COPYRIGHT

2026, dev@trafficserver.apache.org
