title: How to pass response body field to other request's body (Gatling)
body: <p>I have two end point.</p>
  
  <p><strong>-/authenticate</strong> </p>
  
  <p><strong>-/authenticate/verification</strong></p>
  
  <p><strong>/authenticate</strong> return guid field on response body.
  and <strong>/authenticate/verification</strong> requires that field  on request body.</p>
  
  <p>I have tried to get guid like this :</p>
  
  <p><code>jsonPath("$..guid").saveAs("verificationGuid")</code></p>
  
  <p>and pass it to other body :</p>
  
  <p><code>.body(StringBody(s"{\"guid\":${verificationGuid}, \"code\":\"123456\"}"))</code> </p>
  
  <p>this is the code block: </p>
  
  <pre><code> def login = {
      exec(http("Authenticate")
        .post("/authenticate")
        .body(StringBody(userString))
        .headers(headerLogin)
        .check(status is 200)
        .check(jsonPath("$..guid").saveAs("verificationGuid"))
      )
      .exec(http( "Authenticate verify")
      .post("/authenticate/verify")
      .headers(headerLogin)
      .body(StringBody(s"{\"guid\":${verificationGuid}, \"code\":\"123456\"}"))
      .check(status is 200)
      )
    }
  </code></pre>
  
  <p>But it doesnt work, how can I do this?</p>