0

我目前正在尝试让我的 Apache 模块响应自定义错误消息,例如 400 包含附加信息,例如“坐标超出范围”。

我在谷歌上找到了多个消息来源说这是可能的,但没有人能告诉我怎么做。那么是否有一些功能可以让我这样做:

return apache_error( 400, "Coordinate %d is out of bounds.", coord.x );

?

提前致谢。

4

1 回答 1

1

您可以在 request_rec 的 status_line 成员上设置它。

snprintf(buf, buf_size, "%d Coordinate %d is out of bounds", 400, coord.x);
req->status_line = buf;
req->status = 400;
于 2009-07-15T06:40:29.417 回答