Package spark
Class Service
java.lang.Object
spark.Service
Represents a Spark server "session".
If a user wants multiple 'Sparks' in his application the method
ignite() should be statically
imported and used to create instances. The instance should typically be named so when prefixing the 'routing' methods
the semantic makes sense. For example 'http' is a good variable name since when adding routes it would be:
Service http = ignite();
...
http.get("/hello", (q, a) -> "Hello World");-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionfinal classProvides static files utility methods. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected booleanprotected Stringprotected intprotected intprotected intfinal Redirectprotected Routesprotected EmbeddedServerstatic final intprotected SslStoresfinal Service.StaticFilesprotected intprotected Map<String, WebSocketHandlerWrapper> -
Method Summary
Modifier and TypeMethodDescriptionintvoidaddFilter(String httpMethod, FilterImpl filter) Deprecated.voidaddFilter(HttpMethod httpMethod, FilterImpl filter) Adds a filtervoidDeprecated.voidaddRoute(HttpMethod httpMethod, RouteImpl route) Adds a routevoidMaps a filter to be executed after any matching routesvoidMaps a filter to be executed after any matching routesvoidMaps a filter to be executed after any matching routesvoidafterAfter(String path, Filter filter) Maps a filter to be executed after any matching routes even if the route throws any exceptionvoidafterAfter(Filter filter) Maps a filter to be executed after any matching routes even if the route throws any exceptionvoidWaits for the spark server to be initialized.voidWaits for the Spark server to stop.voidMaps a filter to be executed before any matching routesvoidMaps a filter to be executed before any matching routesvoidMaps a filter to be executed before any matching routesvoidMap the route for HTTP CONNECT requestsvoidconnect(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP CONNECT requestsvoidconnect(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP CONNECT requestsvoidMap the route for HTTP CONNECT requestsvoidconnect(String path, Route route, ResponseTransformer transformer) Map the route for HTTP CONNECT requestsvoidconnect(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP CONNECT requestsvoiddefaultResponseTransformer(ResponseTransformer transformer) Sets default response transformervoidMap the route for HTTP DELETE requestsvoiddelete(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP DELETE requestsvoiddelete(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP DELETE requestsvoidMap the route for HTTP DELETE requestsvoiddelete(String path, Route route, ResponseTransformer transformer) Map the route for HTTP DELETE requestsvoiddelete(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP DELETE requestsGet the identifier used to select the EmbeddedServer; null for the default.voidSet the identifier used to select the EmbeddedServer; null for the default.<T extends Exception>
voidexception(Class<T> exceptionClass, ExceptionHandler<? super T> handler) Maps an exception handler to be executed when an exception occurs during routingexternalStaticFileLocation(String externalFolder) Sets the external folder serving static files.voidMap the route for HTTP GET requestsvoidget(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP GET requestsvoidget(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP GET requestsvoidMap the route for HTTP GET requestsvoidget(String path, Route route, ResponseTransformer transformer) Map the route for HTTP GET requestsvoidget(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP GET requestsgetPaths()halt()Immediately stops a request within a filter or route NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not workhalt(int status) Immediately stops a request within a filter or route with specified status code NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not workImmediately stops a request within a filter or route with specified status code and body content NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not workImmediately stops a request within a filter or route with specified body content NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not workvoidMap the route for HTTP HEAD requestsvoidhead(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP HEAD requestsvoidhead(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP HEAD requestsvoidMap the route for HTTP HEAD requestsvoidhead(String path, Route route, ResponseTransformer transformer) Map the route for HTTP HEAD requestsvoidhead(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP HEAD requestsstatic Serviceignite()Creates a new Service (a Spark instance).voidinit()voidinitExceptionHandler(Consumer<Exception> initExceptionHandler) Overrides default exception handler during initialization phasevoidinternalServerError(String page) Maps 500 internal server errors to the provided custom pagevoidinternalServerError(Route route) Maps 500 internal server errors to the provided route.Set the IP address that Spark should listen on.voidMaps 404 errors to the provided custom pagevoidMaps 404 errors to the provided route.voidMap the route for HTTP OPTIONS requestsvoidoptions(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP OPTIONS requestsvoidoptions(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP OPTIONS requestsvoidMap the route for HTTP OPTIONS requestsvoidoptions(String path, Route route, ResponseTransformer transformer) Map the route for HTTP OPTIONS requestsvoidoptions(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP OPTIONS requestsvoidMap the route for HTTP PATCH requestsvoidpatch(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP PATCH requestsvoidpatch(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PATCH requestsvoidMap the route for HTTP PATCH requestsvoidpatch(String path, Route route, ResponseTransformer transformer) Map the route for HTTP PATCH requestsvoidpatch(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PATCH requestsvoidpath(String path, RouteGroup routeGroup) Add a path-prefix to the routes declared in the routeGroup The path() method adds a path-fragment to a path-stack, adds routes from the routeGroup, then pops the path-fragment again.intport()Retrieves the port that Spark is listening on.port(int port) Set the port that Spark should listen on.voidMap the route for HTTP POST requestsvoidpost(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP POST requestsvoidpost(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP POST requestsvoidMap the route for HTTP POST requestsvoidpost(String path, Route route, ResponseTransformer transformer) Map the route for HTTP POST requestsvoidpost(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP POST requestsvoidMap the route for HTTP PUT requestsvoidput(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP PUT requestsvoidput(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PUT requestsvoidMap the route for HTTP PUT requestsvoidput(String path, Route route, ResponseTransformer transformer) Map the route for HTTP PUT requestsvoidput(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP PUT requestsroutes()secure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword) Set the connection to be secure, using the specified keystore and truststore.secure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword, boolean needsClientCert) Set the connection to be secure, using the specified keystore and truststore.secure(String keystoreFile, String keystorePassword, String certAlias, String truststoreFile, String truststorePassword) Set the connection to be secure, using the specified keystore and truststore.secure(String keystoreFile, String keystorePassword, String certAlias, String truststoreFile, String truststorePassword, boolean needsClientCert) Set the connection to be secure, using the specified keystore and truststore.staticFileLocation(String folder) Sets the folder in classpath serving static files.voidstop()Stops the Spark server and clears all routes.threadPool(int maxThreads) Configures the embedded web server's thread pool.threadPool(int maxThreads, int minThreads, int idleTimeoutMillis) Configures the embedded web server's thread pool.voidMap the route for HTTP TRACE requestsvoidtrace(String path, String acceptType, Route route, ResponseTransformer transformer) Map the route for HTTP TRACE requestsvoidtrace(String path, String acceptType, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP TRACE requestsvoidMap the route for HTTP TRACE requestsvoidtrace(String path, Route route, ResponseTransformer transformer) Map the route for HTTP TRACE requestsvoidtrace(String path, TemplateViewRoute route, TemplateEngine engine) Map the route for HTTP TRACE requestsbooleanUnmaps a particular route from the collection of those that have been previously routed.booleanUnmaps a particular route from the collection of those that have been previously routed.voidMaps the given path to the given WebSocket handler class.voidMaps the given path to the given WebSocket handler instance.webSocketIdleTimeoutMillis(int timeoutMillis) Sets the max idle timeout in milliseconds for WebSocket connections.
-
Field Details
-
SPARK_DEFAULT_PORT
public static final int SPARK_DEFAULT_PORT- See Also:
-
DEFAULT_ACCEPT_TYPE
- See Also:
-
initialized
protected boolean initialized -
port
protected int port -
ipAddress
-
sslStores
-
webSocketHandlers
-
maxThreads
protected int maxThreads -
minThreads
protected int minThreads -
threadIdleTimeoutMillis
protected int threadIdleTimeoutMillis -
webSocketIdleTimeoutMillis
-
server
-
pathDeque
-
routes
-
redirect
-
staticFiles
-
-
Method Details
-
ignite
Creates a new Service (a Spark instance). This should be used instead of the static API if the user wants multiple services in one process.- Returns:
- the newly created object
-
embeddedServerIdentifier
Set the identifier used to select the EmbeddedServer; null for the default.- Parameters:
obj- the identifier passed toEmbeddedServers.
-
embeddedServerIdentifier
Get the identifier used to select the EmbeddedServer; null for the default.- Parameters:
obj- the identifier passed toEmbeddedServers.
-
ipAddress
Set the IP address that Spark should listen on. If not called the default address is '0.0.0.0'. This has to be called before any route mapping is done.- Parameters:
ipAddress- The ipAddress- Returns:
- the object with IP address set
-
port
Set the port that Spark should listen on. If not called the default port is 4567. This has to be called before any route mapping is done. If provided port = 0 then the an arbitrary available port will be used.- Parameters:
port- The port number- Returns:
- the object with port set
-
port
public int port()Retrieves the port that Spark is listening on.- Returns:
- The port Spark server is listening on.
- Throws:
IllegalStateException- when the server is not started
-
secure
public Service secure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword) Set the connection to be secure, using the specified keystore and truststore. This has to be called before any route mapping is done. You have to supply a keystore file, truststore file is optional (keystore will be reused). By default, client certificates are not checked. This method is only relevant when using embedded Jetty servers. It should not be used if you are using Servlets, where you will need to secure the connection in the servlet container- Parameters:
keystoreFile- The keystore file location as stringkeystorePassword- the password for the keystoretruststoreFile- the truststore file location as string, leave null to reuse keystoretruststorePassword- the trust store password- Returns:
- the object with connection set to be secure
-
secure
public Service secure(String keystoreFile, String keystorePassword, String certAlias, String truststoreFile, String truststorePassword) Set the connection to be secure, using the specified keystore and truststore. This has to be called before any route mapping is done. You have to supply a keystore file, truststore file is optional (keystore will be reused). By default, client certificates are not checked. This method is only relevant when using embedded Jetty servers. It should not be used if you are using Servlets, where you will need to secure the connection in the servlet container- Parameters:
keystoreFile- The keystore file location as stringkeystorePassword- the password for the keystorecertAlias- the default certificate AliastruststoreFile- the truststore file location as string, leave null to reuse keystoretruststorePassword- the trust store password- Returns:
- the object with connection set to be secure
-
secure
public Service secure(String keystoreFile, String keystorePassword, String truststoreFile, String truststorePassword, boolean needsClientCert) Set the connection to be secure, using the specified keystore and truststore. This has to be called before any route mapping is done. You have to supply a keystore file, truststore file is optional (keystore will be reused). This method is only relevant when using embedded Jetty servers. It should not be used if you are using Servlets, where you will need to secure the connection in the servlet container- Parameters:
keystoreFile- The keystore file location as stringkeystorePassword- the password for the keystoretruststoreFile- the truststore file location as string, leave null to reuse keystoretruststorePassword- the trust store passwordneedsClientCert- Whether to require client certificate to be supplied in request- Returns:
- the object with connection set to be secure
-
secure
public Service secure(String keystoreFile, String keystorePassword, String certAlias, String truststoreFile, String truststorePassword, boolean needsClientCert) Set the connection to be secure, using the specified keystore and truststore. This has to be called before any route mapping is done. You have to supply a keystore file, truststore file is optional (keystore will be reused). This method is only relevant when using embedded Jetty servers. It should not be used if you are using Servlets, where you will need to secure the connection in the servlet container- Parameters:
keystoreFile- The keystore file location as stringkeystorePassword- the password for the keystorecertAlias- the default certificate AliastruststoreFile- the truststore file location as string, leave null to reuse keystoretruststorePassword- the trust store passwordneedsClientCert- Whether to require client certificate to be supplied in request- Returns:
- the object with connection set to be secure
-
threadPool
Configures the embedded web server's thread pool.- Parameters:
maxThreads- max nbr of threads.- Returns:
- the object with the embedded web server's thread pool configured
-
threadPool
Configures the embedded web server's thread pool.- Parameters:
maxThreads- max nbr of threads.minThreads- min nbr of threads.idleTimeoutMillis- thread idle timeout (ms).- Returns:
- the object with the embedded web server's thread pool configured
-
staticFileLocation
Sets the folder in classpath serving static files. Observe: this method must be called before all other methods.- Parameters:
folder- the folder in classpath.- Returns:
- the object with folder set
-
externalStaticFileLocation
Sets the external folder serving static files. Observe: this method must be called before all other methods.- Parameters:
externalFolder- the external folder serving static files.- Returns:
- the object with external folder set
-
unmap
Unmaps a particular route from the collection of those that have been previously routed. Search for previously established routes using the given path and unmaps any matches that are found.- Parameters:
path- the route path- Returns:
- true if this is a matching route which has been previously routed
- Throws:
IllegalArgumentException- if path is null or blank
-
unmap
Unmaps a particular route from the collection of those that have been previously routed. Search for previously established routes using the given path and HTTP method, unmaps any matches that are found.- Parameters:
path- the route pathhttpMethod- the http method- Returns:
- true if this is a matching route that has been previously routed
- Throws:
IllegalArgumentException- if path is null or blank or if httpMethod is null, blank, or an invalid HTTP method
-
webSocket
Maps the given path to the given WebSocket handler class.This is currently only available in the embedded server mode.
- Parameters:
path- the WebSocket path.handlerClass- the handler class that will manage the WebSocket connection to the given path.
-
webSocket
Maps the given path to the given WebSocket handler instance.This is currently only available in the embedded server mode.
- Parameters:
path- the WebSocket path.handler- the handler instance that will manage the WebSocket connection to the given path.
-
webSocketIdleTimeoutMillis
Sets the max idle timeout in milliseconds for WebSocket connections.- Parameters:
timeoutMillis- The max idle timeout in milliseconds.- Returns:
- the object with max idle timeout set for WebSocket connections
-
notFound
Maps 404 errors to the provided custom page- Parameters:
page- the custom 404 error page.
-
internalServerError
Maps 500 internal server errors to the provided custom page- Parameters:
page- the custom 500 internal server error page.
-
notFound
Maps 404 errors to the provided route. -
internalServerError
Maps 500 internal server errors to the provided route. -
awaitInitialization
public void awaitInitialization()Waits for the spark server to be initialized. If it's already initialized will return immediately -
stop
public void stop()Stops the Spark server and clears all routes. -
awaitStop
public void awaitStop()Waits for the Spark server to stop. Warning: this method should not be called from a request handler. -
path
Add a path-prefix to the routes declared in the routeGroup The path() method adds a path-fragment to a path-stack, adds routes from the routeGroup, then pops the path-fragment again. It's used for separating routes into groups, for example: path("/api/email", () -> { ....post("/add", EmailApi::addEmail); ....put("/change", EmailApi::changeEmail); ....etc }); Multiple path() calls can be nested.- Parameters:
path- the path to prefix routes withrouteGroup- group of routes (can also contain path() calls)
-
getPaths
-
routes
- Returns:
- all routes information from this service
-
addRoute
Adds a route- Parameters:
httpMethod- the HTTP methodroute- the route implementation
-
addFilter
Adds a filter- Parameters:
httpMethod- the HTTP methodfilter- the route implementation
-
addRoute
Deprecated. -
addFilter
Deprecated. -
init
public void init() -
activeThreadCount
public int activeThreadCount()- Returns:
- The approximate number of currently active threads in the embedded Jetty server
-
exception
public <T extends Exception> void exception(Class<T> exceptionClass, ExceptionHandler<? super T> handler) Maps an exception handler to be executed when an exception occurs during routing- Parameters:
exceptionClass- the exception classhandler- The handler
-
halt
Immediately stops a request within a filter or route NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not work- Returns:
- HaltException object
-
halt
Immediately stops a request within a filter or route with specified status code NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not work- Parameters:
status- the status code- Returns:
- HaltException object with status code set
-
halt
Immediately stops a request within a filter or route with specified body content NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not work- Parameters:
body- The body content- Returns:
- HaltException object with body set
-
halt
Immediately stops a request within a filter or route with specified status code and body content NOTE: When using this don't catch exceptions of type HaltException, or if catched, re-throw otherwise halt will not work- Parameters:
status- The status codebody- The body content- Returns:
- HaltException object with status and body set
-
initExceptionHandler
Overrides default exception handler during initialization phase- Parameters:
initExceptionHandler- The custom init exception handler
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathroute- The route
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathroute- The route
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathroute- The route
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathroute- The route
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathroute- The route
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathroute- The route
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathroute- The route
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathroute- The route
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathroute- The route
-
before
Maps a filter to be executed before any matching routes- Parameters:
path- the pathfilter- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
path- the pathfilter- The filter
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathacceptType- the accept typeroute- The route
-
before
Maps a filter to be executed before any matching routes- Parameters:
filter- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
filter- The filter
-
before
Maps a filter to be executed before any matching routes- Parameters:
path- the pathacceptType- the accept typefilter- The filter
-
after
Maps a filter to be executed after any matching routes- Parameters:
path- the pathacceptType- the accept typefilter- The filter
-
afterAfter
Maps a filter to be executed after any matching routes even if the route throws any exception- Parameters:
filter- The filter
-
afterAfter
Maps a filter to be executed after any matching routes even if the route throws any exception- Parameters:
filter- The filter
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathroute- The routeengine- the template engine
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathacceptType- the accept typeroute- The routeengine- the template engine
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
get
Map the route for HTTP GET requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
post
Map the route for HTTP POST requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
put
Map the route for HTTP PUT requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
delete
Map the route for HTTP DELETE requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
head
Map the route for HTTP HEAD requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
connect
Map the route for HTTP CONNECT requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
trace
Map the route for HTTP TRACE requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
options
Map the route for HTTP OPTIONS requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathroute- The routetransformer- the response transformer
-
patch
Map the route for HTTP PATCH requests- Parameters:
path- the pathacceptType- the accept typeroute- The routetransformer- the response transformer
-
defaultResponseTransformer
Sets default response transformer- Parameters:
transformer-
-