# Leverage jsonPath in code outside scnarios

**URL:** https://community.gatling.io/t/leverage-jsonpath-in-code-outside-scnarios/2905
**Category:** Gatling (Open-Source)
**Created:** [April 6, 2016, 11:25am UTC](https://community.gatling.io/t/leverage-jsonpath-in-code-outside-scnarios/2905 "2016-04-06T11:25:47Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Sathyakumar\_Seshacha](https://avatars.discourse-cdn.com/v4/letter/s/e274bd/32.png) [@Sathyakumar\_Seshacha](https://community.gatling.io/u/Sathyakumar_Seshacha)
#### Post date: [April 6, 2016, 11:25am UTC](https://community.gatling.io/t/leverage-jsonpath-in-code-outside-scnarios/2905/1 "2016-04-06T11:25:47Z")

</div>

Refer [http://stackoverflow.com/questions/36441740/extract-value-from-json-and-use-in-another-exec](http://stackoverflow.com/questions/36441740/extract-value-from-json-and-use-in-another-exec)  
I basically want to construct an URL that I will use in my scenarios, The URL can only be constructed by making an API call. Is there an option at all. It looks like you just need to use scalajava’s http libraries to do those calls.

---

<div class="post-metadata">

### Author: ![slandelle](https://dub1.discourse-cdn.com/flex013/user_avatar/community.gatling.io/slandelle/32/4_2.png) [@slandelle](https://community.gatling.io/u/slandelle)
#### Post date: [April 6, 2016, 7:08pm UTC](https://community.gatling.io/t/leverage-jsonpath-in-code-outside-scnarios/2905/2 "2016-04-06T19:08:13Z")

</div>

You can’t use Gatling DSL outside the load test itself. Use [AsyncHttpClient](https://github.com/AsyncHttpClient/async-http-client), which is our underlying Java HTTP client.
