MCPcopy
hub / github.com/psf/requests / test_json_encodes_as_bytes

Function test_json_encodes_as_bytes

tests/test_requests.py:2615–2620  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2613
2614
2615def test_json_encodes_as_bytes():
2616 # urllib3 expects bodies as bytes-like objects
2617 body = {"key": "value"}
2618 p = PreparedRequest()
2619 p.prepare(method="GET", url="https://www.example.com/", json=body)
2620 assert isinstance(p.body, bytes)
2621
2622
2623def test_requests_are_updated_each_time(httpbin):

Callers

nothing calls this directly

Calls 2

prepareMethod · 0.95
PreparedRequestClass · 0.90

Tested by

no test coverage detected