How to get url from redirect?

Is it possible after send request get a url from redirect to variable? e.g. I request for and this link redirect me to, can I get /token/123?

val scn = scenario(“Scenario Name”)

I tried with this but occurs error header.find.exists, found nothing but in Fiddler I see this header

val scn = scenario(“SCENARIO2”)
.exec(session => {
val urlN = session.get(“url”).asOption[String]
print("TEST123 " + urlN.getOrElse(“nie ma”))

By default, redirects occur automatically, and any checks are performed only at the last redirection (‘landing’) location, which will not have a ‘Location’ header in the response.

It seems you need to (globally) override this behaviour with disableFollowRedirect applied to your HTTP configuration ( ref. , HTTP Protocol / Options ), and handle redirections yourself. A temporary/local override would be nice, but there isn’t one.

Also see!topic/gatling/CfP8hSfcFXs .