public class Requests extends Object
| Constructor and Description |
|---|
Requests() |
| Modifier and Type | Method and Description |
|---|---|
static String |
mandatoryBody(spark.Request request)
Given a {@link Request), retreive the value of the request body.
|
static <T> T |
mandatoryQueryParameter(java.util.function.Function<String,Optional<T>> extractParameterFunction,
String parameter)
Given a
Function, retrieve the value of the by applying that function |
static String |
mandatoryQueryParameter(spark.Request request,
String parameter)
Given a
Request object retrieve the value of the argument. |
static Optional<String> |
queryParameter(spark.Request request,
String parameter)
Given a
Request, retrieve the value of the |
public static String mandatoryQueryParameter(spark.Request request, String parameter)
Request object retrieve the value of the argument. If it is not present
in the request query, return a 400 to the client.request - information about the HTTP requestparameter - value to retrieve from the HTTP requestpublic static <T> T mandatoryQueryParameter(java.util.function.Function<String,Optional<T>> extractParameterFunction, String parameter)
Function, retrieve the value of the by applying that functionextractParameterFunction - function used to extract the parameterparameter - value to retrieve from the HTTP requestpublic static Optional<String> queryParameter(spark.Request request, String parameter)
Request, retrieve the value of the request - information about the HTTP requestparameter - value to retrieve from the HTTP requestpublic static String mandatoryBody(spark.Request request)
request - information about the HTTP requestCopyright © 2017 Grakn Labs Ltd. All rights reserved.