接口 HttpCallback
-
public interface HttpCallbackThe callback for http connection.- 从以下版本开始:
- 2.9
-
-
方法概要
修饰符和类型 方法 说明 voiddone(URI uri, HttpResponse responseCode, ByteBuf buf, Throwable error)Call when http connection finish.HttpHandlerActionpreview(URI uri, HttpResponse response)Specify what should be done next
-
-
-
方法详细资料
-
done
void done(URI uri, HttpResponse responseCode, ByteBuf buf, Throwable error)
Call when http connection finish.- 参数:
uri- The connect uri.responseCode- The response.buf- Http contexterror- The error if connect failed.
-
preview
HttpHandlerAction preview(URI uri, HttpResponse response)
Specify what should be done next- 参数:
uri- Current URIresponse- The response in current connect. Use it to get headers.- 返回:
null if undo anything.HttpHandlerAction.CONTINUEreal full context. Even if this is an error page.HttpHandlerAction.RESET_DEPTHLike *null*. and it will reset depth times.HttpHandlerAction.CANCELCancel this connection.(calldone(URI, HttpResponse, ByteBuf, Throwable)with a error.)HttpHandlerAction.ENDcalldone(URI, HttpResponse, ByteBuf, Throwable)with empty context.HttpHandlerAction.redirect(String)Redirect to giving url.HttpHandlerAction.redirectAndReset(String)Redirect to giving url and reset depth times.
-
-