How to get values from dictionaries (e.g. cookies and headers)

You can get a value from a dictionary by using the C# syntax

dictionary["key"]

for example

BLOCK:ConstantDictionary
  value = {("key", "value")}
  => VAR @DICT
ENDBLOCK

LOG DICT["key"]

You can use this to get values from the data.COOKIES and data.HEADERS dictionaries like this:

  • data.COOKIES["PHPSESSID"]
  • data.HEADERS["Authorization"]

If you instead want to get a key by value, you can use the GetKey block under Functions > Dictionary Functions.

Ruri

3 Likes