@@ -28,6 +28,7 @@ def __init__(self,
2828 disable_metrics : bool = False ,
2929 disable_registration : bool = False ,
3030 custom_headers : dict = {},
31+ custom_options : dict = {},
3132 custom_strategies : dict = {},
3233 cache_directory : str = None ) -> None :
3334 """
@@ -41,6 +42,7 @@ def __init__(self,
4142 :param metrics_interval: Metrics refresh interval in ms, optional & defaults to 60 seconds
4243 :param disable_metrics: Disables sending metrics to unleash server, optional & defaults to false.
4344 :param custom_headers: Default headers to send to unleash server, optional & defaults to empty.
45+ :param custom_options: Default requests parameters, optional & defaults to empty.
4446 :param custom_strategies: Dictionary of custom strategy names : custom strategy objects
4547 :param cache_directory: Location of the cache directory. When unset, FCache will determine the location
4648 """
@@ -54,6 +56,7 @@ def __init__(self,
5456 self .unleash_disable_metrics = disable_metrics
5557 self .unleash_disable_registration = disable_registration
5658 self .unleash_custom_headers = custom_headers
59+ self .unleash_custom_options = custom_options
5760 self .unleash_static_context = {
5861 "appName" : self .unleash_app_name ,
5962 "environment" : self .unleash_environment
@@ -101,6 +104,7 @@ def initialize_client(self) -> None:
101104 "app_name" : self .unleash_app_name ,
102105 "instance_id" : self .unleash_instance_id ,
103106 "custom_headers" : self .unleash_custom_headers ,
107+ "custom_options" : self .unleash_custom_options ,
104108 "cache" : self .cache ,
105109 "features" : self .features ,
106110 "strategy_mapping" : self .strategy_mapping
@@ -111,14 +115,16 @@ def initialize_client(self) -> None:
111115 "app_name" : self .unleash_app_name ,
112116 "instance_id" : self .unleash_instance_id ,
113117 "custom_headers" : self .unleash_custom_headers ,
118+ "custom_options" : self .unleash_custom_options ,
114119 "features" : self .features ,
115120 "ondisk_cache" : self .cache
116121 }
117122
118123 # Register app
119124 if not self .unleash_disable_registration :
120125 register_client (self .unleash_url , self .unleash_app_name , self .unleash_instance_id ,
121- self .unleash_metrics_interval , self .unleash_custom_headers , self .strategy_mapping )
126+ self .unleash_metrics_interval , self .unleash_custom_headers ,
127+ self .unleash_custom_options , self .strategy_mapping )
122128
123129 fetch_and_load_features (** fl_args )
124130
0 commit comments