replace_variables

Function replace_variables 

Source
pub fn replace_variables(body: &str, params: &HashMap<String, String>) -> String
Expand description

Replaces placeholders in the response body with actual values.

  • body: The response template with placeholders.
  • params: A map containing request parameters (e.g., query or path params).

Supports:

  • {{timestamp}} → Current UTC timestamp
  • Other {{var}} → Replaced with values from params