Documentation Index Fetch the complete documentation index at: https://easyaf.dev/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Assembly: CloudNimble.Breakdance.DotHttp.dll
Namespace: CloudNimble.Breakdance.DotHttp
Inheritance: System.Object
Syntax
CloudNimble . Breakdance . DotHttp . VariableResolver
Summary
Resolves {{variable}} placeholders in .http file content.
Supports simple variables, dynamic variables (d a t e t i m e , datetime, d a t e t im e , randomInt, etc.),
and response references for request chaining per the Microsoft .http file specification.
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "baseUrl" , "https://api.example.com" );
resolver . SetVariable ( "apiKey" , "my-secret-key" );
var result = resolver . Resolve ( "GET {{baseUrl}}/users?key={{apiKey}}" );
// result = "GET https://api.example.com/users?key=my-secret-key"
Constructors
.ctor
Syntax
public VariableResolver ()
.ctor Inherited
Syntax
Methods
Clear
Clears all stored variables.
Syntax
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "foo" , "bar" );
resolver . Clear ();
// All variables are now removed
Equals Inherited Virtual
Syntax
public virtual bool Equals ( object obj )
Parameters
Name Type Description objobject?-
Returns
Type: bool
Equals Inherited
Syntax
public static bool Equals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
GetHashCode Inherited Virtual
Syntax
public virtual int GetHashCode ()
Returns
Type: int
GetResponseReferenceNames
Extracts all response reference names from the input.
Syntax
public System . Collections . Generic . HashSet < string > GetResponseReferenceNames ( string input )
Parameters
Name Type Description inputstringThe input string.
Returns
Type: System.Collections.Generic.HashSet<string>
Set of request names that are referenced.
Examples
var resolver = new VariableResolver ();
var input = "Authorization: Bearer {{login.response.body.$.token}}" ;
var names = resolver . GetResponseReferenceNames ( input );
// names contains "login"
GetType Inherited
Syntax
public System . Type GetType ()
Returns
Type: System.Type
GetVariableNames
Extracts all variable names from the input string.
Syntax
public System . Collections . Generic . HashSet < string > GetVariableNames ( string input )
Parameters
Name Type Description inputstringThe input string.
Returns
Type: System.Collections.Generic.HashSet<string>
Set of variable names found.
Examples
var resolver = new VariableResolver ();
var input = "{{baseUrl}}/users/{{userId}}" ;
var names = resolver . GetVariableNames ( input );
// names contains "baseUrl" and "userId"
HasResponseReferences
Checks if a string contains response references ({{name.response.*}}).
Syntax
public bool HasResponseReferences ( string input )
Parameters
Name Type Description inputstringThe input string to check.
Returns
Type: bool
True if response references are present.
Examples
var resolver = new VariableResolver ();
var hasRefs = resolver . HasResponseReferences ( "Bearer {{login.response.body.$.token}}" );
// hasRefs = true
HasUnresolvedVariables
Checks if a string contains any unresolved variable references.
Syntax
public bool HasUnresolvedVariables ( string input )
Parameters
Name Type Description inputstringThe input string to check.
Returns
Type: bool
True if unresolved variables remain.
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "baseUrl" , "https://api.example.com" );
var resolved = resolver . Resolve ( "{{baseUrl}}/{{userId}}" );
var hasUnresolved = resolver . HasUnresolvedVariables ( resolved );
// hasUnresolved = true (userId was not set)
MemberwiseClone Inherited
Syntax
protected internal object MemberwiseClone ()
Returns
Type: object
ReferenceEquals Inherited
Syntax
public static bool ReferenceEquals ( object objA , object objB )
Parameters
Name Type Description objAobject?- objBobject?-
Returns
Type: bool
Resolve
Resolves all variable references in the input string.
Syntax
public string Resolve ( string input )
Parameters
Name Type Description inputstringThe input string containing {{variable}} placeholders.
Returns
Type: string
The resolved string with variables replaced.
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "baseUrl" , "https://api.example.com" );
var result = resolver . Resolve ( "GET {{baseUrl}}/users" );
// result = "GET https://api.example.com/users"
ResolveDynamicVariables
Resolves dynamic variables like d a t e t i m e , datetime, d a t e t im e , randomInt, $timestamp, etc.
Syntax
public string ResolveDynamicVariables ( string input )
Parameters
Name Type Description inputstringThe input string.
Returns
Type: string
The resolved string.
Examples
var resolver = new VariableResolver ();
var result = resolver . ResolveDynamicVariables ( "ID: {{$guid}}" );
// result = "ID: 550e8400-e29b-41d4-a716-446655440000" (example GUID)
ResolveSimpleVariables
Resolves simple {{variable}} placeholders.
Syntax
public string ResolveSimpleVariables ( string input )
Parameters
Name Type Description inputstringThe input string.
Returns
Type: string
The resolved string.
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "name" , "John" );
var result = resolver . ResolveSimpleVariables ( "Hello, {{name}}!" );
// result = "Hello, John!"
SetVariable
Sets a variable value for resolution.
Syntax
public void SetVariable ( string name , string value )
Parameters
Name Type Description namestringThe variable name (without @ prefix or wrapper). valuestringThe variable value.
Examples
var resolver = new VariableResolver ();
resolver . SetVariable ( "baseUrl" , "https://api.example.com" );
SetVariables
Sets multiple variables at once.
Syntax
public void SetVariables ( System . Collections . Generic . IDictionary < string , string > variables )
Parameters
Name Type Description variablesSystem.Collections.Generic.IDictionary<string, string>Dictionary of variable names and values.
Examples
var resolver = new VariableResolver ();
resolver . SetVariables ( new Dictionary & lt ; string , string & gt ;
{
[ "baseUrl" ] = "https://api.example.com" ,
[ "apiKey" ] = "secret-key"
});
ToString Inherited Virtual
Syntax
public virtual string ToString ()
Returns
Type: string?