in azure/functions/http.py [0:0]
def __init__(self,
method: str,
url: str, *,
headers: typing.Mapping[str, str],
params: typing.Mapping[str, str],
route_params: typing.Mapping[str, str],
body_type: str,
body: typing.Union[str, bytes]) -> None:
body_str: typing.Optional[str] = None
body_bytes: typing.Optional[bytes] = None
if isinstance(body, str):
body_str = body
body_bytes = body_str.encode('utf-8')
elif isinstance(body, bytes):
body_bytes = body
else:
raise TypeError(
f'unexpected HTTP request body type: {type(body).__name__}')
super().__init__(method=method, url=url, headers=headers,
params=params, route_params=route_params,
body=body_bytes)
self.__body_type = body_type
self.__body_str = body_str
self.__body_bytes = body_bytes