Below is the base request whose upon redirection is supposed to carry the response that I need to use in another request
I am trying like this
val httpProtocol = http
.baseURL("https://www.testciq.com").check(regex("""<input type=\"hidden\" name=\"__VIEWSTATEGENERATOR\" id=\"__VIEWSTATEGENERATOR\" value=\"(.*)/>""").saveAs("VIEWSTATEGENERATOR"),regex("""<input type=\"hidden\" name=\"__EVENTVALIDATION\" id=\"__EVENTVALIDATION\" value=\"(.*)/>""").saveAs("EVENTVALIDATION"),regex("""<input type=\"hidden\" name=\"__VIEWSTATE\" id=\"__VIEWSTATE\" value=\"(.*)/>\"""").saveAs("VIEWSTATE"))
.inferHtmlResources(BlackList(""".*\.js""", """.*\.css""", """.*\.gif""", """.*\.jpeg""", """.*\.jpg""", """.*\.ico""", """.*\.woff""", """.*\.(t|o)tf""", """.*\.png"""), WhiteList())
.acceptHeader("*/*")
.acceptEncodingHeader("gzip, deflate, br")
.acceptLanguageHeader("en-US,en;q=0.5")
.connection("keep-alive")
.contentTypeHeader("application/x-www-form-urlencoded")
.userAgentHeader("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0")
and using the saved values in another request like below:
http("MainLogin")
.post("https:// sso.beta.mhfi.com:443/oam/server/auth_cred_submit")
.headers(headers_0)
.formParam("__EVENTTARGET", "")
.formParam("__EVENTARGUMENT", "")
.formParam("__VIEWSTATE", "${VIEWSTATE}")
.formParam("__VIEWSTATEGENERATOR","${VIEWSTATEGENERATOR}")
.formParam("__EVENTVALIDATION", "${EVENTVALIDATION}")
.formParam("captchaValidated", "0")
But this is not working... Any help would be greatly appreciated...Thanks