TSHttpHdrStatusSet

Synopsis

#include <ts/ts.h>
TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status)
TSReturnCode TSHttpHdrStatusSet(TSMBuffer bufp, TSMLoc offset, TSHttpStatus status, TSHttpTxn txnp, std::string_view setter)

Description

Sets the HTTP status code on an existing HTTP header object. An overload also accepts the transaction and an identifying setter label. When provided, the setter is recorded on the transaction for logging via the prscs log field.

Parameters

  • bufp: Marshal buffer containing the HTTP header.

  • offset: Location of the HTTP header within bufp.

  • status: The HTTP status code to set.

  • txnp: Optional transaction handle on which to record the setter label.

  • setter: Optional label identifying the component setting the status; pass empty to leave unchanged.