Browse Source

Remove code examples for Python 3.8 in `response_headers`

pull/14510/head
Yurii Motov 7 months ago
parent
commit
9764538478
  1. 4
      docs/en/docs/advanced/response-headers.md
  2. 0
      docs_src/response_headers/tutorial001_py39.py
  3. 0
      docs_src/response_headers/tutorial002_py39.py
  4. 2
      tests/test_tutorial/test_response_headers/test_tutorial001.py
  5. 2
      tests/test_tutorial/test_response_headers/test_tutorial002.py

4
docs/en/docs/advanced/response-headers.md

@ -6,7 +6,7 @@ You can declare a parameter of type `Response` in your *path operation function*
And then you can set headers in that *temporal* response object.
{* ../../docs_src/response_headers/tutorial002.py hl[1, 7:8] *}
{* ../../docs_src/response_headers/tutorial002_py39.py hl[1, 7:8] *}
And then you can return any object you need, as you normally would (a `dict`, a database model, etc).
@ -22,7 +22,7 @@ You can also add headers when you return a `Response` directly.
Create a response as described in [Return a Response Directly](response-directly.md){.internal-link target=_blank} and pass the headers as an additional parameter:
{* ../../docs_src/response_headers/tutorial001.py hl[10:12] *}
{* ../../docs_src/response_headers/tutorial001_py39.py hl[10:12] *}
/// note | Technical Details

0
docs_src/response_headers/tutorial001.py → docs_src/response_headers/tutorial001_py39.py

0
docs_src/response_headers/tutorial002.py → docs_src/response_headers/tutorial002_py39.py

2
tests/test_tutorial/test_response_headers/test_tutorial001.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from docs_src.response_headers.tutorial001 import app
from docs_src.response_headers.tutorial001_py39 import app
client = TestClient(app)

2
tests/test_tutorial/test_response_headers/test_tutorial002.py

@ -1,6 +1,6 @@
from fastapi.testclient import TestClient
from docs_src.response_headers.tutorial002 import app
from docs_src.response_headers.tutorial002_py39 import app
client = TestClient(app)

Loading…
Cancel
Save