private static string GetVariableIdentifier(string variableName, bool strict, VariableType type) { if (variableName != null) { return(ContextVariable.Get(variableName, strict)); } switch (type) { case VariableType.Request: return(ContextRequest.GetBody(true)); case VariableType.Response: return(ContextResponse.Get(true)); case VariableType.Undefined: default: throw new ArgumentOutOfRangeException(nameof(type), type, null); } }
public static string IsRequestBodyNull(bool inline = false) { return($"string.IsNullOrEmpty({ContextRequest.GetBodyAsString(true)})".ToPolicyCode(inline)); }