TSHttpTxnErrorBodySet

Sets an error type body to a transaction.

概要

#include <ts/ts.h>
void TSHttpTxnErrorBodySet(TSHttpTxn txnp, char *buf, size_t buflength, char *mimetype)

解説

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).

TSHttpTxnErrorBodyGet

Gets the error body as set above.

概要

#include <ts/ts.h>
char *TSHttpTxnErrorBodyGet(TSHttpTxn txnp, size_t *buflength, char **mimetype)

解説

This is the getter version for the above setter. The mimetype and the buflength arguments can be nullptr if the caller is not interested in the mimetype or the length.