如何将所述 curl 转换为等效的 scala Gatling 代码?

How to convert the said curl to equivalent scala Gatling code?

请帮助如何将以下 curl 转换为等效的 scala Gatling 代码?

            curl --location --request POST 'https://test.salesforce.com/services/oauth2/token' \
            --header 'Content-Type: application/x-www-form-urlencoded' \
            --header 'Cookie: BrowserId=DbIfsfsf' \
            --data-urlencode 'username=webapi@abc.com.uat1' \
            --data-urlencode 'client_id=xxx' \
            --data-urlencode 'client_secret=xxxx' \
            --data-urlencode 'grant_type=password' \
            --data-urlencode 'password=xxxx'

这里有关于你问题的所有答案https://gatling.io/docs/current/http/http_request


val myRequest = http("my request")
    .post("https://test.salesforce.com/services/oauth2/token")
    .header(HttpHeaderNames.ContentType, HttpHeaderValues.ApplicationFormUrlEncoded)
    .header("Cookie", "BrowserId=DbIfsfsf")
    .formParam("username", "webapi@abc.com.uat1")
    .formParam("client_id", "xxx")
    .formParam("client_secret", "xxxx")
    .formParam("grant_type", "password")
    .formParam("password", "xxxx")