Submit and vote on feature ideas.

Welcome to the new Parasoft forums! We hope you will enjoy the site and try out some of the new features, like sharing an idea you may have for one of our products or following a category.

How to validate the date given in the request

Options

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

  • williammccusker
    williammccusker Posts: 643 ✭✭✭
    Options

    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.