@FunctionalInterface public interface HttpService extends Service<HttpRequest,HttpResponse>
Service.| Modifier and Type | Method and Description |
|---|---|
default HttpService |
decorate(DecoratingHttpServiceFunction function)
Creates a new
HttpService that decorates this HttpService with the specified
DecoratingHttpServiceFunction. |
default <R extends Service<R_I,R_O>,R_I extends Request,R_O extends Response> |
decorate(Function<? super HttpService,R> decorator)
|
HttpResponse |
serve(ServiceRequestContext ctx,
HttpRequest req)
Serves an incoming
Request. |
as, decorate, serviceAdded, shouldCachePathHttpResponse serve(ServiceRequestContext ctx, HttpRequest req) throws Exception
ServiceRequest.serve in interface Service<HttpRequest,HttpResponse>ctx - the context of the received Requestreq - the received RequestResponseExceptiondefault <R extends Service<R_I,R_O>,R_I extends Request,R_O extends Response> R decorate(Function<? super HttpService,R> decorator)
default HttpService decorate(DecoratingHttpServiceFunction function)
HttpService that decorates this HttpService with the specified
DecoratingHttpServiceFunction.Copyright © 2020 LeanCloud. All rights reserved.