load_str_bytes
Loads and deserializes data from a string or bytes object using a specified protocol, such as JSON or pickle, based on the provided content type or protocol argument.
def load_str_bytes(
b: str | bytes,
content_type: str | None = None,
encoding: str = 'utf8',
proto: Protocol | None = None,
allow_pickle: bool = False,
json_loads: Callable[[str], Any] = json.loads
) - > Any
load_str_bytes is deprecated.
Parameters
| Name | Type | Description |
|---|---|---|
| b | `str | bytes` |
| content_type | `str | None` = None |
| encoding | str = 'utf8' | The character encoding used to decode byte input when processing JSON data. |
| proto | `Protocol | None` = None |
| allow_pickle | bool = False | A security flag that must be set to True to enable unpickling of data. |
| json_loads | Callable[[str], Any] = json.loads | The specific JSON loading function used to parse string data. |
Returns
| Type | Description |
|---|---|
Any | The deserialized object parsed from the input string or bytes using the specified protocol. |