@@ -54,6 +54,25 @@ def environment(self, environment):
5454 self .http_instance .headers ['environment' ] = environment
5555 return self
5656
57+ def remove_environment (self ):
58+ """Removes environment from the request headers
59+ :return: Entry, so we can chain the call
60+ -------------------------------
61+ Example::
62+
63+ >>> import contentstack
64+ >>> stack = contentstack.Stack('api_key', 'delivery_token', 'environment')
65+ >>> content_type = stack.content_type('content_type_uid')
66+ >>> entry = content_type.entry(uid='entry_uid')
67+ >>> entry = entry.environment('test')
68+ >>> entry = entry.remove_environment()
69+ >>> result = entry.fetch()
70+ -------------------------------
71+ """
72+ if 'environment' in self .http_instance .headers :
73+ self .http_instance .headers .pop ('environment' )
74+ return self
75+
5776 def version (self , version ):
5877 """When no version is specified, it returns the latest version
5978 To retrieve a specific version, specify the version number under this parameter.
@@ -96,6 +115,9 @@ def param(self, key, value):
96115 """
97116 if None in (key , value ) and not isinstance (key , str ):
98117 raise ValueError (ErrorMessages .INVALID_KEY_VALUE_ARGS )
118+ # Convert non-string values to strings
119+ if not isinstance (value , str ):
120+ value = str (value )
99121 self .entry_param [key ] = value
100122 return self
101123
0 commit comments