MCPcopy
hub / github.com/encode/httpx / primitive_value_to_str

Function primitive_value_to_str

httpx/_utils.py:15–27  ·  httpx/_utils.py::primitive_value_to_str

Coerce a primitive data type into a string value. Note that we prefer JSON-style 'true'/'false' for boolean values here.

(value: PrimitiveData)

Source from the content-addressed store, hash-verified

13
14
15def primitive_value_to_str(value: PrimitiveData) -> str:
16 class="st">"""
17 Coerce a primitive data type into a string value.
18
19 Note that we prefer JSON-style &class="cm">#x27;trueclass="st">'/'false' for boolean values here.
20 class="st">"""
21 if value is True:
22 return class="st">"true"
23 elif value is False:
24 return class="st">"false"
25 elif value is None:
26 return class="st">""
27 return str(value)
28
29
30def get_environment_proxies() -> dict[str, str | None]:

Callers 5

encode_urlencoded_dataFunction · 0.85
__init__Method · 0.85
__init__Method · 0.85
setMethod · 0.85
addMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected