How to validate the date given in the request

Below is request URL
http://localhost:9080/accountsdetails?startTime=2019-09-27

I want to validate startTime whether it is older than 7 days from the current date or not. If it is older I want to return error message or with some responder.

Comments

  • williammccuskerwilliammccusker Posts: 211 ✭✭

    Hi,
    There isn't a built in correlation for date so what you could do is setup a "custom" responder correlation. The scripting language "groovy" should give an example script that shows how to access the different parts of the request. In your case you want the one the gets the "CorrelationScriptingHookConstants.URL_PARAMS" and then you can script the date checking.

Sign In or Register to comment.