Skip to content
Myr

Force HTTP/1.1 on short-lived connections (#284)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Seth Michael Larson · committed by GitHub · parent 8ea32e6 · Browse files · 5 files+13 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

5 files+13 added−6 removed

  • tests:+1 added−0 removed
  • other:+12 added−6 removed

5 files+13 added−6 removed

modified:docs/api.md+8 added-2 removed
modified:docs/index.md+1 added-1 removed
38 unmodified lines
39<Response [200 OK]>40>>> r.status_code4120042>>> r.http_version43'HTTP/2'43'HTTP/1.1'44>>> r.headers['content-type']45'text/html; charset=UTF-8'46>>> r.text47'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
68 unmodified lines
modified:httpx/api.py+1 added-1 removed
31 unmodified lines
32 verify: VerifyTypes = True,33 stream: bool = False,34 trust_env: bool = None,35) -> Response:36 with Client() as client:36 with Client(http_versions=["HTTP/1.1"]) as client:37 return client.request(38 method=method,39 url=url,40 data=data,
247 unmodified lines
modified:tests/test_api.py+1 added
27 unmodified lines
28 response = httpx.get("http://127.0.0.1:8000/")29 assert response.status_code == 20030 assert response.reason_phrase == "OK"31 assert response.text == "Hello, world!"32 assert response.http_version == "HTTP/1.1"333435@threadpool36def test_post(server):
56 unmodified lines
modified:README.md+2 added-2 removed
27 unmodified lines
28>>> r29<Response [200 OK]>30>>> r.status_code3120032>>> r.protocol33'HTTP/2'32>>> r.http_version33'HTTP/1.1'34>>> r.headers['content-type']35'text/html; charset=UTF-8'36>>> r.text37'<!doctype html>\n<html>\n<head>\n<title>Example Domain</title>...'
77 unmodified lines