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

# TSHttpTxnClientReqGet(3ts)

TSHttpTxnClientReqGet API function

## NAME

TSHttpTxnClientReqGet - TSHttpTxnClientReqGet API function

## SYNOPSIS

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

- ***TSReturnCode* TSHttpTxnClientReqGet(*TSHttpTxn* txnp, *TSMBuffer* \*bufp, *TSMLoc* \*offset)**

  ## DESCRIPTION

Get the client request. The *txnp* must be passed in and the values in *bufp* and *offset* are updated to refer to the client request in the transaction. A typical use case would look like

```
int
CB_Read_Req_Hdr_Hook(TSCont contp, TSEvent event, void* data) {
   auto txnp = reinterpret_cast<TSHttpTxn>(data);
   TSMBuffer creq_buff;
   TSMLoc creq_loc;
   if (TS_SUCCESS == TSHttpTxnClientReqGet(txnp, &creq_buff, &creq_loc)) {
      // use the client request
   } // else values in creq_buff, creq_loc are garbage.
   TSHttpTxnReenable(txnp);
   return 0;
}
```

The values placed in *bufp* and *offset* are stable for the transaction and need only be retrieved once per transaction. Note these values are valid only if this function returns **TS\_SUCCESS**.

## COPYRIGHT

2026, dev@trafficserver.apache.org
