Package org.mockserver.model
Class HttpRequestModifier
java.lang.Object
org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
org.mockserver.model.ObjectWithJsonToString
org.mockserver.model.HttpRequestModifier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleangetPath()inthashCode()static HttpRequestModifierwithCookies(CookiesModifier cookies) withHeaders(HeadersModifier headers) The regex and substitution values to use to modify matching substrings, if multiple matches are found they will all be modified with the substitution for full details of supported regex syntax see: http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.htmlwithPath(PathModifier path) withQueryStringParameters(Parameters add, Parameters replace, List<String> remove) withQueryStringParameters(QueryParametersModifier queryStringParameters) Methods inherited from class org.mockserver.model.ObjectWithJsonToString
toStringMethods inherited from class org.mockserver.model.ObjectWithReflectiveEqualsHashCodeToString
fieldsExcludedFromEqualsAndHashCode
-
Constructor Details
-
HttpRequestModifier
public HttpRequestModifier()
-
-
Method Details
-
requestModifier
-
getPath
-
withPath
-
withPath
The regex and substitution values to use to modify matching substrings, if multiple matches are found they will all be modified with the substitution for full details of supported regex syntax see: http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html
The substitution can specify matching groups using $ followed by the group number for example $1
If a null or empty substitution string is provided the regex pattern will be used to remove any substring matching the regex
For example:
regex: ^/(.+)/(.+)$ substitution: /prefix/$1/infix/$2/postfix then: /some/path => /prefix/some/infix/path/postfix or: /some/longer/path => /prefix/some/infix/longer/path/postfix
- Parameters:
regex- regex value to match onsubstitution- the value to substitute for the regex
-
getQueryStringParameters
-
withQueryStringParameters
-
withQueryStringParameters
public HttpRequestModifier withQueryStringParameters(Parameters add, Parameters replace, List<String> remove) -
withQueryStringParameters
-
getHeaders
-
withHeaders
-
withHeaders
-
getCookies
-
withCookies
-
withCookies
-
equals
- Overrides:
equalsin classObjectWithReflectiveEqualsHashCodeToString
-
hashCode
public int hashCode()- Overrides:
hashCodein classObjectWithReflectiveEqualsHashCodeToString
-