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

Function test_build_request

tests/client/test_client.py:47–59  ·  tests/client/test_client.py::test_build_request
(server)

Source from the content-addressed store, hash-verified

45
46
47def test_build_request(server):
48 url = server.url.copy_with(path=class="st">"/echo_headers")
49 headers = {class="st">"Custom-header": class="st">"value"}
50
51 with httpx.Client() as client:
52 request = client.build_request(class="st">"GET", url)
53 request.headers.update(headers)
54 response = client.send(request)
55
56 assert response.status_code == 200
57 assert response.url == url
58
59 assert response.json()[class="st">"Custom-header"] == class="st">"value"
60
61
62def test_build_post_request(server):

Callers

nothing calls this directly

Calls 5

build_requestMethod · 0.80
jsonMethod · 0.80
copy_withMethod · 0.45
updateMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected