Package io.github.sigmacasino
Class PostRoute
java.lang.Object
io.github.sigmacasino.HTTPRoute
io.github.sigmacasino.PostRoute
- All Implemented Interfaces:
spark.Route
- Direct Known Subclasses:
HorsesPost
,LoginPost
,RegisterPost
,ResetPasswordPost
,RoulettePost
,StripeDeposit
,StripeWebhook
,StripeWithdraw
A route that handles POST requests.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static org.slf4j.Logger
The logger for the PostRoute class.Fields inherited from class io.github.sigmacasino.HTTPRoute
app, loginRequired, path
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Object
handle
(spark.Request request, spark.Response response) Runs super.handle() and then calls handlePost().abstract void
handlePost
(spark.Request request, spark.Response response) Handles a POST request.parseBodyParams
(spark.Request request) Parses the body of a POST request into a map of key-value pairs.final void
Registers the route with Spark.
-
Field Details
-
postRouteLogger
private static org.slf4j.Logger postRouteLoggerThe logger for the PostRoute class.
-
-
Constructor Details
-
PostRoute
Constructs a new PostRoute.- Parameters:
app
- app instance, passed to the super contructorpath
- the path of the route, passed to the super contructor
-
-
Method Details
-
handle
Runs super.handle() and then calls handlePost(). -
registerSparkRoute
public final void registerSparkRoute()Description copied from class:HTTPRoute
Registers the route with Spark.- Specified by:
registerSparkRoute
in classHTTPRoute
-
handlePost
Handles a POST request.- Parameters:
request
- the requestresponse
- the response- Throws:
SQLException
-
parseBodyParams
Parses the body of a POST request into a map of key-value pairs. The body must be encoded in the application/x-www-form-urlencoded format.- Parameters:
request
- the request to parse- Returns:
- a map of key-value pairs
-