# How to capture request params generated dynamically from GET request to correlate next POST request

**URL:** <https://community.gatling.io/t/how-to-capture-request-params-generated-dynamically-from-get-request-to-correlate-next-post-request/8276>\
**Category:** Gatling (Open-Source)\
**Tags:** gatling-academy\
**Created:** [September 7, 2023, 11:21am UTC](https://community.gatling.io/t/how-to-capture-request-params-generated-dynamically-from-get-request-to-correlate-next-post-request/8276 "2023-09-07T11:21:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Srini](https://avatars.discourse-cdn.com/v4/letter/s/e9bcb4/32.png) [@Srini](https://community.gatling.io/u/Srini)\
**Post date:** [September 7, 2023, 11:21am UTC](https://community.gatling.io/t/how-to-capture-request-params-generated-dynamically-from-get-request-to-correlate-next-post-request/8276/1 "2023-09-07T11:21:23Z")

</div>

Hi,  
While launching the SAP application, the initial two GET requests get param “sap-context-id” and the same needs to pass on to other upcoming requests.  
The strange part is I am not getting the “sap-context-id” in the GET response, but I can see the same in the GET request params.  
My query … Is it possible to capture the “sap-context-id” param from the GET request param so that I can save it to the variable and use it in the upcoming requests?  
I appreciate your help.

Sample Request params

HTTP/1.1 302 Found  
set-cookie: sap-login-XSRF\_QM1=0; expires=Tue, 01-Jan-1980 00:00:01 GMT; path=/; SameSite=None; secure  
set-cookie: sap-usercontext=sap-language=EN&sap-client=100; path=/; SameSite=None; secure  
set-cookie: SAP\_SESSIONID\_QM1\_100=mveVEzdw3Mv63vwXvgKj0wL6aydNAhHulIKRnCjLVyU%3d; path=/; SameSite=None; secure  
content-type: text/html; charset=utf-8  
content-length: 5  
sap-err-id: ICFLOGONREQUIRED  
location: /sap/bc/ui2/flp?saml2=disabled&\_sap-hash=JTIzU2hlbGwtaG9tZQ&sap-system-login=X&sap-system-login-cookie=X&\*\*sap-contextid=\*\*SID:ANON:IKAWEQQM1AS01\_QM1\_22:aK-vnihlk8JcmIebDTWefQVnZujrJlbmE8-etYjR-ATT  
sap-server: true

---

<div class="post-metadata">

**Author:** ![GeMi](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/gemi/32/939_2.png) [@GeMi](https://community.gatling.io/u/GeMi)\
**Post date:** [September 7, 2023, 8:08pm UTC](https://community.gatling.io/t/how-to-capture-request-params-generated-dynamically-from-get-request-to-correlate-next-post-request/8276/2 "2023-09-07T20:08:46Z")

</div>

As I see this is response from redirect and you data is in **location** header → `The HyperText Transfer Protocol (HTTP) 302 Found redirect status response code indicates that the resource requested has been temporarily moved to the URL given by the Location header.`  
So you can easy get it from it - example of this in 28 line:

> <https://github.com/gemiusz/gatling-examples-maven-java/blob/master/src/test/java/pl/gemiusz/Case0026ResponseHeaderRegexSimulation.java>

---

<div class="post-metadata">

**Author:** ![system](https://europe1.discourse-cdn.com/flex013/uploads/gatling2/original/2X/b/b148e0742de35c6280726cabf3ecd3de2d320f63.png) [@system](https://community.gatling.io/u/system)\
**Post date:** [October 7, 2023, 8:09pm UTC](https://community.gatling.io/t/how-to-capture-request-params-generated-dynamically-from-get-request-to-correlate-next-post-request/8276/3 "2023-10-07T20:09:40Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
