- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 141 for headers (0.16 sec)
-
docs/zh/docs/advanced/response-headers.md
# 响应头 ## 使用 `Response` 参数 你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies做的那样)。 然后你可以在这个*临时*响应对象中设置头部。 ```Python hl_lines="1 7-8" {!../../../docs_src/response_headers/tutorial002.py!} ``` 然后你可以像平常一样返回任何你需要的对象(例如一个`dict`或者一个数据库模型)。如果你声明了一个`response_model`,它仍然会被用来过滤和转换你返回的对象。 **FastAPI**将使用这个临时响应来提取头部(也包括cookies和状态码),并将它们放入包含你返回的值的最终响应中,该响应由任何`response_model`过滤。 你也可以在依赖项中声明`Response`参数,并在其中设置头部(和cookies)。 ## 直接返回 `Response`
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Apr 18 19:53:19 GMT 2024 - 2K bytes - Viewed (0) -
docs/en/docs/advanced/response-headers.md
And as the `Response` can be used frequently to set headers and cookies, **FastAPI** also provides it at `fastapi.Response`. ## Custom Headers Keep in mind that custom proprietary headers can be added <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">using the 'X-' prefix</a>.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 2.2K bytes - Viewed (0) -
docs/de/docs/advanced/response-headers.md
Und da die `Response` häufig zum Setzen von Headern und Cookies verwendet wird, stellt **FastAPI** diese auch unter `fastapi.Response` bereit. ## Benutzerdefinierte Header Beachten Sie, dass benutzerdefinierte proprietäre Header <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">mittels des Präfix 'X-'</a> hinzugefügt werden können.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 30 20:19:06 GMT 2024 - 2.6K bytes - Viewed (0) -
docs/es/docs/advanced/response-headers.md
Y como la `Response` puede ser usada frecuentemente para configurar headers y cookies, **FastAPI** también la provee en `fastapi.Response`. ## Headers Personalizados Ten en cuenta que se pueden añadir headers propietarios personalizados <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">usando el prefijo 'X-'</a>.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Wed Feb 07 12:51:12 GMT 2024 - 2.5K bytes - Viewed (0) -
docs/em/docs/advanced/response-headers.md
## 🛃 🎚 ✔️ 🤯 👈 🛃 © 🎚 💪 🚮 <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">⚙️ '✖-' 🔡</a>.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Apr 01 09:26:04 GMT 2023 - 1.9K bytes - Viewed (0) -
docs/zh/docs/tutorial/cors.md
* 创建一个允许的源列表(由字符串组成)。 * 将其作为「中间件」添加到你的 **FastAPI** 应用中。 你也可以指定后端是否允许: * 凭证(授权 headers,Cookies 等)。 * 特定的 HTTP 方法(`POST`,`PUT`)或者使用通配符 `"*"` 允许所有方法。 * 特定的 HTTP headers 或者使用通配符 `"*"` 允许所有 headers。 ```Python hl_lines="2 6-11 13-19" {!../../../docs_src/cors/tutorial001.py!} ``` 默认情况下,这个 `CORSMiddleware` 实现所使用的默认参数较为保守,所以你需要显式地启用特定的源、方法或者 headers,以便浏览器能够在跨域上下文中使用它们。 支持以下参数:
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 27 17:28:07 GMT 2021 - 4.5K bytes - Viewed (0) -
docs/en/docs/tutorial/middleware.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Thu Jan 11 16:31:18 GMT 2024 - 2.9K bytes - Viewed (0) -
docs/de/docs/tutorial/middleware.md
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Tue Jan 23 11:26:59 GMT 2024 - 3.4K bytes - Viewed (0) -
docs/zh/docs/tutorial/middleware.md
{!../../../docs_src/middleware/tutorial001.py!} ``` !!! tip 请记住可以 <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers" class="external-link" target="_blank">用'X-' 前缀</a>添加专有自定义请求头. 但是如果你想让浏览器中的客户端看到你的自定义请求头, 你需要把它们加到 CORS 配置 ([CORS (Cross-Origin Resource Sharing)](cors.md){.internal-link target=_blank}) 的 `expose_headers` 参数中,在 <a href="https://www.starlette.io/middleware/#corsmiddleware" class="external-link" target="_blank">Starlette's CORS docs</a>文档中.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Mar 27 17:25:21 GMT 2021 - 2.7K bytes - Viewed (0) -
docs/ko/docs/tutorial/cors.md
* `allow_headers` - 교차-출처를 지원하는 HTTP 요청 헤더의 리스트입니다. 기본값은 `[]` 입니다. 모든 헤더들을 허용하기 위해 `['*']` 를 사용할 수 있습니다. `Accept`, `Accept-Language`, `Content-Language` 그리고 `Content-Type` 헤더는 CORS 요청시 언제나 허용됩니다. * `allow_credentials` - 교차-출처 요청시 쿠키 지원 여부를 설정합니다. 기본값은 `False` 입니다. 또한 해당 항목을 허용할 경우 `allow_origins` 는 `['*']` 로 설정할 수 없으며, 출처를 반드시 특정해야 합니다. * `expose_headers` - 브라우저에 접근할 수 있어야 하는 모든 응답 헤더를 가리킵니다. 기본값은 `[]` 입니다.
Plain Text - Registered: Sun May 05 07:19:11 GMT 2024 - Last Modified: Sat Jan 07 14:21:23 GMT 2023 - 5.8K bytes - Viewed (0)