Class FromRequest
java.lang.Object
org.springframework.cloud.contract.spec.internal.FromRequest
Helper class to reference the request body parameters.
- Since:
- 1.1.0
- Author:
- Marcin Grzejszczak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbody()Request body text (avoid for non-text bodies).Request body text for the given JsonPath.Retruns the tempalte for retrieving the first value of a cookie with certain key.First value of a request header e.g.nth value of a request header (zero indexed) e.g.path()URL path.path(int index) nth value of a URL path (zero indexed) e.g.First value of a query parameter e.g.nth value of a query parameter (zero indexed) e.g.rawBody()Unescaped Request body text (avoid for non-text bodies).Unescaped Request body text for the given JsonPath.Unescaped Returns the template for retrieving the first value of a cookie with certain key.Unescaped First value of a request header e.g.Unescaped nth value of a request header (zero indexed) e.g.rawPath()Unescaped URL path.rawPath(int index) Unescaped nth value of a URL path (zero indexed) e.g.Unescaped First value of a query parameter e.g.Unescaped nth value of a query parameter (zero indexed) e.g.rawUrl()Unescaped URL path and query.url()
-
Constructor Details
-
FromRequest
public FromRequest()
-
-
Method Details
-
url
- Returns:
- URL path and query.
-
query
First value of a query parameter e.g. request.query.search.- Parameters:
key- key for the query param- Returns:
- dsl property
-
query
nth value of a query parameter (zero indexed) e.g. request.query.search.[5].- Parameters:
key- key for the query paramindex- index of the query param- Returns:
- dsl property
-
path
URL path.- Returns:
- dsl property
-
path
nth value of a URL path (zero indexed) e.g. {{{ request.path.[2] }}}* @param index.- Parameters:
index- path index- Returns:
- dsl property
-
header
First value of a request header e.g. request.headers.X-Request-Id.- Parameters:
key- header key- Returns:
- dsl property
-
header
nth value of a request header (zero indexed) e.g. request.headers.X-Request-Id.- Parameters:
key- header keyindex- header index- Returns:
- dsl property
-
cookie
Retruns the tempalte for retrieving the first value of a cookie with certain key.- Parameters:
key- cookie key- Returns:
- dsl property
-
body
Request body text (avoid for non-text bodies).- Returns:
- dsl property
-
body
Request body text for the given JsonPath.- Parameters:
jsonPath- json path body- Returns:
- dsl property
-
rawUrl
Unescaped URL path and query.- Returns:
- dsl property
-
rawQuery
Unescaped First value of a query parameter e.g. request.query.search.- Parameters:
key- query key- Returns:
- dsl property
-
rawQuery
Unescaped nth value of a query parameter (zero indexed) e.g. request.query.search.[5].- Parameters:
key- query keyindex- query index- Returns:
- dsl property
-
rawPath
Unescaped URL path.- Returns:
- dsl property
-
rawPath
Unescaped nth value of a URL path (zero indexed) e.g. {{{ request.path.[2]. }}}*- Parameters:
index- path index- Returns:
- dsl property
-
rawHeader
Unescaped First value of a request header e.g. request.headers.X-Request-Id.- Parameters:
key- header key- Returns:
- dsl property
-
rawHeader
Unescaped nth value of a request header (zero indexed) e.g. request.headers.X-Request-Id.- Parameters:
key- header keyindex- header index- Returns:
- dsl property
-
rawCookie
Unescaped Returns the template for retrieving the first value of a cookie with certain key.- Parameters:
key- cookie key- Returns:
- dsl property
-
rawBody
Unescaped Request body text (avoid for non-text bodies).- Returns:
- dsl property
-
rawBody
Unescaped Request body text for the given JsonPath.- Parameters:
jsonPath- json path body- Returns:
- dsl property
-