# How to achieve parallel https requests within same scenario?

**URL:** <https://community.gatling.io/t/how-to-achieve-parallel-https-requests-within-same-scenario/4817>\
**Category:** Gatling (Open-Source)\
**Created:** [February 12, 2019, 10:58pm UTC](https://community.gatling.io/t/how-to-achieve-parallel-https-requests-within-same-scenario/4817 "2019-02-12T22:58:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vikram\_Verma](https://avatars.discourse-cdn.com/v4/letter/v/ee59a6/32.png) [@Vikram\_Verma](https://community.gatling.io/u/Vikram_Verma)\
**Post date:** [February 12, 2019, 10:58pm UTC](https://community.gatling.io/t/how-to-achieve-parallel-https-requests-within-same-scenario/4817/1 "2019-02-12T22:58:24Z")

</div>

I am trying to figure out a way where I can have multiple http requests execution concurrently within the same scenario. For example:in the following script, I wan to execute request 0 and request 1 to be executed in parallel for every user.

`

package computerdatabase

import io.gatling.core.Predef.\_  
import io.gatling.http.Predef.\_

class Vik123 extends Simulation {

val httpProtocol = http  
.baseUrl(“[http://abc.com](http://abc.com)”)

.acceptEncodingHeader(""“gzip, deflate”"")  
.acceptLanguageHeader(""“fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3"”")  
.userAgentHeader(""“Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:29.0) Gecko/20100101 Firefox/29.0"”")

val headers\_0 = Map(""“Accept”"" → “”“text/html,application/xhtml+xml,application/xml;q=0.9,_/_;q=0.8"”")

val scn = scenario(“Scen1”)  
.exec(http(“request\_0”)  
.get("""/""")  
.headers(headers\_0)  
.resources(http(“request\_1”)  
.get("""/""")  
.headers(headers\_0)))  
.pause(10)

setUp(scn.inject(atOnceUsers(10))).protocols(httpProtocol)  
}  
`

---

<div class="post-metadata">

**Author:** ![Wilmar\_Munoz](https://avatars.discourse-cdn.com/v4/letter/w/ec9cab/32.png) [@Wilmar\_Munoz](https://community.gatling.io/u/Wilmar_Munoz)\
**Post date:** [February 18, 2020, 2:41am UTC](https://community.gatling.io/t/how-to-achieve-parallel-https-requests-within-same-scenario/4817/2 "2020-02-18T02:41:22Z")

</div>

This is exactly what .resources does, take a look to [https://gatling.io/docs/current/http/http\_request/#resources](https://gatling.io/docs/current/http/http_request/#resources)

You just need to create a Seq[HttpRequestBuilder], for example [https://stackoverflow.com/questions/40324276/making-a-variable-number-of-parallel-http-requests-with-gatling](https://stackoverflow.com/questions/40324276/making-a-variable-number-of-parallel-http-requests-with-gatling)
