如何在 Apache 2.2 (c++) 中响应自定义错误响应?
我目前正在尝试让我的 Apache 模块响应自定义错误消息,以便 400 包含附加信息,例如“坐标超出范围”。
我在谷歌上找到了多个消息来源说这是可能的,但没有人能告诉我如何做到。 那么是否有一些功能可以让我做类似的事情:
return apache_error( 400, "Coordinate %d is out of bounds.", coord.x );
?
提前致谢。
I am currently trying to have my Apache module respond with custom error messages, so that a 400 for example contains additional information like "The coordinates are out of bounds".
I found multiple sources on Google saying that it is possible, but none could tell me how. So is there some function that would allow me something like:
return apache_error( 400, "Coordinate %d is out of bounds.", coord.x );
?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以在 request_rec 的 status_line 成员上设置它。
You can set it on the status_line member of request_rec.