Session Variables to expand into Requests

WebSurge sessions support fixed values that you can create as variables and then expand into content using the following format.

Creating Variables

To create variables you can go to the session configuration and enter them into the Session Variables edit box, one line per variable. Variables can be in the following formats:

With @ prefix (Visual Studio style):

@varname=value
@token=x3dfeaea29jsg
@openAiKey=%OPENAI_KEY%

or without:

varname=value
token=x3dfeaea29jsg
openAikey=%OPENAI_KEY%

Common values here can be fixed user tokens, base urls or any other constant values that you might re-use across multiple requests, or need to customize depending on the target that the requests are running against.

Using Environment Variables

You can use Environment variables for variable names by wrapping the variable in %name% sytnax.

Using Variables in Requests

To use the variables in your requests you can embed them into the Url, Headers or Body of any request in the session.

For example in the body you might have:

{
    name: "{{varname}}"
}

In a header you might replace a token.

Authorization: Bearer {{token}}

© West Wind Technologies, 2014-2024 • Updated: 07/07/24
Comment or report problem with topic