title: Citrus Framework - Can a variable be assigned from a response?
body: <p>I'm trying to test the following two REST calls:</p>
  
  <p><strong>Request 1</strong></p>
  
  <pre><code>GET getLatestVersion
  Response: {"version": 10}
  </code></pre>
  
  <p><strong>Request 2</strong></p>
  
  <pre><code>POST getVersionData (body={"version": 10})
  Response: {"version": 10, data: [...]}
  </code></pre>
  
  <p>Is it possible to assign the "version" from Request 1 to a variable to use in Request 2 within the same test?</p>
  
  <pre><code>@CitrusTest(name = "SimpleIT.getVersionTest")
  public void getVersionTest() { 
      // Request 1
      http()
              .client("restClient")
              .send()
              .get("/getLatestVersion")
              .accept("application/json");
  
      http()
              .client("restClient")
              .receive()
              .response(HttpStatus.OK)
              .messageType(MessageType.JSON)
              // Can the version be assigned to a variable here?
              .payload("{\"version\":10}");
  
      // Request 2
      http()
              .client("restClient")
              .send()
              .post("/getVersionData")
              // Idealy this would be a Citrus variable from the previous response
              .payload("{\"version\":10}")
              .accept("application/json");
  
      http()
              .client("restClient")
              .receive()
              .response(HttpStatus.OK)
              .messageType(MessageType.JSON)
              .payload("\"version\": 10, data: [...]");
  }
  </code></pre>