(
		text: ty.Union[str, ty.Iterable[str]], *,
		chunk_size: int = default_chunk_size
)
return stream_bytes(data, chunk_size=chunk_size)
Gets a buffered generator for streaming text.
	
	Returns a buffered generator which encodes a string as
	:mimetype:`multipart/form-data` with the corresponding headers.
	
	Parameters
	----------
	text
		The data bytes to stream
	chunk_size
		The maximum size of each stream chunk
Gets a buffered generator for streaming text.
	
	Returns a buffered generator which encodes a string as
	:mimetype:`multipart/form-data` with the corresponding headers.
	
	Parameters
	----------
	text
		The data bytes to stream
	chunk_size
		The maximum size of each stream chunk
Gets a buffered generator for streaming text . Returns a buffered generator which encodes a string as : mimetype : multipart / form - data with the corresponding headers . Parameters ---------- text The data bytes to stream chunk_size The maximum size of each stream chunk
def stream_text(
		text: ty.Union[str, ty.Iterable[str]], *,
		chunk_size: int = default_chunk_size
) -> ty.Tuple[gen_bytes_t, ty.Dict[str, str]]:
	"""Gets a buffered generator for streaming text.
	
	Returns a buffered generator which encodes a string as
	:mimetype:`multipart/form-data` with the corresponding headers.
	
	Parameters
	----------
	text
		The data bytes to stream
	chunk_size
		The maximum size of each stream chunk
	"""
	if not isinstance(text, str):
		def binary_stream() -> gen_bytes_t:
			for item in text:
				yield item.encode("utf-8")
		data = binary_stream()  # type: ty.Union[gen_bytes_t, bytes]
	else:
		data = text.encode("utf-8")
	
	return stream_bytes(data, chunk_size=chunk_size)
def stream_text ( text : ty . Union [ str , ty . Iterable [ str ] ] , * , chunk_size : int = default_chunk_size ) -> ty . Tuple [ gen_bytes_t , ty . Dict [ str , str ] ] : if not isinstance ( text , str ) : def binary_stream ( ) -> gen_bytes_t : for item in text : yield item . encode ( "utf-8" ) data = binary_stream ( ) # type: ty.Union[gen_bytes_t, bytes] else : data = text . encode ( "utf-8" ) return stream_bytes ( data , chunk_size = chunk_size )