parameters: (self, value)
docstring: Sets a new string as response.  The value set must be either a
          unicode or bytestring.  If a unicode string is set it's encoded
          automatically to the charset of the response (utf-8 by default).
  
          .. versionadded:: 0.9
docstring_summary: Sets a new string as response.  The value set must be either a
          unicode or bytestring.  If a unicode string is set it's encoded
          automatically to the charset of the response (utf-8 by default).
docstring_tokens: Sets a new string as response . The value set must be either a unicode or bytestring . If a unicode string is set it s encoded automatically to the charset of the response ( utf - 8 by default ) .
function: def set_data(self, value):
          """Sets a new string as response.  The value set must be either a
          unicode or bytestring.  If a unicode string is set it's encoded
          automatically to the charset of the response (utf-8 by default).
  
          .. versionadded:: 0.9
          """
          # if an unicode string is set, it's encoded directly so that we
          # can set the content length
          if isinstance(value, text_type):
              value = value.encode(self.charset)
          else:
              value = bytes(value)
          self.response = [value]
          if self.automatically_set_content_length:
              self.headers["Content-Length"] = str(len(value))
function_tokens: def set_data ( self , value ) : # if an unicode string is set, it's encoded directly so that we # can set the content length if isinstance ( value , text_type ) : value = value . encode ( self . charset ) else : value = bytes ( value ) self . response = [ value ] if self . automatically_set_content_length : self . headers [ "Content-Length" ] = str ( len ( value ) )