How to escape session variable processing?

I have a request that is like the following…


val bodyJson = “”"{“id”:“001”, “heading”:“Dear ${first_name}”}"""

val httpRequest = http(“Some Request”)
.header(“Authorization”, “${access_token}”)


I need “Dear ${first_name}” to be literal. How do I escape the text “${first_name}” so that it will not get processed as a session variable? I’ve tried various means of escaping special chars, but nothing’s working. My current work around is to set the following before executing the request, but that seems extremely janky AND adds an extra step to all of my chains.

.exec(session => session.set(“first_name”, “${first_name}”))



We don’t currently have such escaping, sorry: you’re the first one to ever ask.
Do you feel like contributing?

I’m new to Scala and Gatling. I guess I could try. Where do I start?

Here’s the compiler:
And here’s the spec where to add tests:

This is non trivial: you have to be familiar with parsers, and then learn Scala Parser Combinators.

Good luck :slight_smile: