---
name: "TSHttpTxnErrorBodySet"
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/TSHttpTxnErrorBodySet"
---

# TSHttpTxnErrorBodySet(3ts)

sets an error type body to a transaction

## NAME

TSHttpTxnErrorBodySet - sets an error type body to a transaction

## SYNOPSIS

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

- **void TSHttpTxnErrorBodySet(*TSHttpTxn* txnp, char \*buf, size\_t buflength, char \*mimetype)**

  ## DESCRIPTION

Note that both string arguments must be allocated with *TSmalloc()* or *TSstrdup()*.  The *mimetype* is optional, and if not provided it defaults to **text/html**. Sending an empty string would prevent setting a content type header (but that is not advised).

## COPYRIGHT

2026, dev@trafficserver.apache.org
