public class Params
A set of HTTP parameters provided as part of request; can represent headers, path parameters or query string parameters.
Parameter lookup is case-insensitive in accordance with the HTTP spec. For example, if a request contains the header "Content-Type" then the value will be returned when looked up as follows:
val contentType = req.headers["content-type"]
This class does not support repeated values in query strings as API Gateway doesn't support them.
For example, a query string of foo=123&foo=456 will only contain one value for foo. It is
undefined which one.
| Modifier and Type | Class and Description |
|---|---|
static class |
Params.Companion |
| Modifier and Type | Field and Description |
|---|---|
static Params.Companion |
Companion |
| Constructor and Description |
|---|
Params(java.util.Map<java.lang.String,java.lang.String> params)
A set of HTTP parameters provided as part of request; can represent headers, path parameters or
query string parameters.
|
Params() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
get(java.lang.String name)
Returns the named parameter or throws
IllegalArgumentException if there is no parameter with the name. |
java.util.Map<java.lang.String,java.lang.String> |
getParams() |
Params |
minus(java.lang.String name)
Returns copy of these parameters with the named parameter removed.
|
java.lang.String |
optional(java.lang.String name)
Returns the named parameter.
|
Params |
plus(kotlin.Pair<java.lang.String,java.lang.String> nameValue)
Returns copy of these parameters with the value added.
|
public static Params.Companion Companion
public Params(java.util.Map<java.lang.String,java.lang.String> params)
A set of HTTP parameters provided as part of request; can represent headers, path parameters or query string parameters.
Parameter lookup is case-insensitive in accordance with the HTTP spec. For example, if a request contains the header "Content-Type" then the value will be returned when looked up as follows:
val contentType = req.headers["content-type"]
This class does not support repeated values in query strings as API Gateway doesn't support them.
For example, a query string of foo=123&foo=456 will only contain one value for foo. It is
undefined which one.
public Params()
public java.util.Map<java.lang.String,java.lang.String> getParams()
public java.lang.String get(java.lang.String name)
Returns the named parameter or throws IllegalArgumentException if there is no parameter with the name.
public Params plus(kotlin.Pair<java.lang.String,java.lang.String> nameValue)
Returns copy of these parameters with the value added.
The value overwrites an existing parameter with the same name.
public Params minus(java.lang.String name)
Returns copy of these parameters with the named parameter removed.
public java.lang.String optional(java.lang.String name)
Returns the named parameter.