-
- Downloads
Add optional argument error_callback to attach_fd().
Add an optional argument error_callback to Request->attach_fd(). The argument is a function, which is called when parse_post() cannot parse the request data. That may happen if a server receives malformed mime data. The error_callback is called with two arguments: - the Protocols.HTTP.Server.Request instance, - the error-description that was returned by catch. A typical way to handle such an error is to send a "400 Bad Request" response: void my_error_callback(Protocols.HTTP.Server.Request req, mixed error) { req->response_and_finish(([ "error": 400, "type": "text/plain", "data": "Bad Request\n" ])); }
Please register or sign in to comment