TSHTTPTXNCLIENTREQGET(3ts)

πŸ“¦
version 9.2.5 Β· 4 versions
, in ubuntu noble, ubuntu questing

πŸ’– TSHTTPTXNCLIENTREQGET πŸ’–

okay bestie, so this is a page from the Apache Traffic Server manual, section 3ts (that's the library-functions corner of the manual, iykyk). Sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

TSHttpTxnClientReqGet β€” the API function that goes and gets you the client request. That's it, that's the whole job. πŸŽ€


🌸 SYNOPSIS 🌸

#include <ts/ts.h>

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

literally the whole signature, no notes. πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So. You want the client request? This function hands it over. 🫢

You must pass in txnp, and then bufp and offset get updated so they point at the client request inside that transaction. That's the vibe.

A typical use case lowkey looks like this:

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;
}
⚠️ okay important: if it does not return TS_SUCCESS, then the values sitting in creq_buff and creq_loc are garbage. Not "maybe fine". Garbage. Do not use them, bestie. 😭

The values that get placed into bufp and offset are stable for the transaction, which means you only need to retrieve them once per transaction</> β€” no need to keep calling this thing like it's a group chat you're refreshing. πŸ’€

And heads up: those values are valid only if this function returns TS_SUCCESS. That's the whole rule. Periodt. πŸ‘‘


2026, dev@trafficserver.apache.org


and that's the whole page, bestie!! 🧚 this was Apache Traffic Server version 9.2, dated Feb 12, 2026, and yes the function name is a whole mouthful β€” TSHttpTxnClientReqGet, section 3ts β€” but you ate that. πŸ’–βœ¨πŸŒˆ mwah, go write some slay plugins πŸŽ€πŸ’œ

πŸ“¦ where this page comes from