From fb5c0e43a10b849dc14c15c1826a9b25408c0261 Mon Sep 17 00:00:00 2001 From: hasansezertasan Date: Sat, 25 May 2024 00:02:10 +0300 Subject: [PATCH] Translation completed, ready tp PR. --- docs/tr/docs/advanced/response-headers.md | 36 +++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/docs/tr/docs/advanced/response-headers.md b/docs/tr/docs/advanced/response-headers.md index 49b5fe476..6a8f3fb6f 100644 --- a/docs/tr/docs/advanced/response-headers.md +++ b/docs/tr/docs/advanced/response-headers.md @@ -1,42 +1,42 @@ -# Response Headers +# Yanıt Başlıkları -## Use a `Response` parameter +## Bir `Response` Parametresi Kullanın -You can declare a parameter of type `Response` in your *path operation function* (as you can do for cookies). +*yol operasyonu fonksiyonunuzda* `Response` türünde bir parametre belirleyebilirsiniz (tıpkı çerezlerde olduğu gibi). -And then you can set headers in that *temporal* response object. +Ardından *geçici* yanıt nesnesinde başlıkları belirleyebilirsiniz. ```Python hl_lines="1 7-8" {!../../../docs_src/response_headers/tutorial002.py!} ``` -And then you can return any object you need, as you normally would (a `dict`, a database model, etc). +Sonunda normalde döndürdüğünüz gibi herhangi bir nesneyi döndürebilirsiniz (bir `dict`, bir veritabanı modeli, vb). -And if you declared a `response_model`, it will still be used to filter and convert the object you returned. +Eğer bir `response_model` belirlediyseniz, döndürdüğünüz nesneyi filtrelemek ve dönüştürmek için kullanılacaktır. -**FastAPI** will use that *temporal* response to extract the headers (also cookies and status code), and will put them in the final response that contains the value you returned, filtered by any `response_model`. +**FastAPI** bu *geçici* yanıtı başlıkları (ayrıca durum kodunu ve çerezleri) çıkarmak için kullanacak ve döndürdüğünüz değeri herhangi bir `response_model` tarafından filtreleyerek son yanıta koyacaktır. -You can also declare the `Response` parameter in dependencies, and set headers (and cookies) in them. +Bağımlılıklarda da `Response` parametresini belirtebilir ve başlıkları belirleyebilirsiniz. -## Return a `Response` directly +## Bir `Response`'u Doğrudan Döndürün -You can also add headers when you return a `Response` directly. +Doğrudan bir `Response` döndürürken başlıklar oluşturabilirsiniz. -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: +Bunun için [Return a Response Directly](response-directly.md){.internal-link target=_blank} sayfasında açıklandığı gibi bir yanıt oluşturup başlkları ekleyin: ```Python hl_lines="10-12" {!../../../docs_src/response_headers/tutorial001.py!} ``` -!!! note "Technical Details" - You could also use `from starlette.responses import Response` or `from starlette.responses import JSONResponse`. +!!! note "Teknik Detaylar" + Projenize dahil etmek için `from starlette.responses import Response` veya `from starlette.responses import JSONResponse` kullanabilirsiniz. - **FastAPI** provides the same `starlette.responses` as `fastapi.responses` just as a convenience for you, the developer. But most of the available responses come directly from Starlette. + **FastAPI**, geliştiricilere kolaylık sağlamak amacıyla `starlette.responses`'ı `fastapi.responses` olarak sağlar. Ancak mevcut yanıtların çoğu doğrudan Starlette'den gelir. Aynı durum `status` için de geçerlidir. - And as the `Response` can be used frequently to set headers and cookies, **FastAPI** also provides it at `fastapi.Response`. + `Response` sıklıkla başlıkları ve çerezleri belirlemek için kullanılabileceği için, **FastAPI** ayrıca `fastapi.Response`'ı da sağlar. -## Custom Headers +## Özelleştirilmiş Başlıklar -Keep in mind that custom proprietary headers can be added using the 'X-' prefix. +Aklınızda bulundurun ki özel başlıklar, 'X-' öneki kullanılarak eklenmelidir. -But if you have custom headers that you want a client in a browser to be able to see, you need to add them to your CORS configurations (read more in [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md){.internal-link target=_blank}), using the parameter `expose_headers` documented in Starlette's CORS docs. +Tarayıcıdaki bir istemcinin görüntüleyebilmesini istediğiniz özel başlıklarınız varsa, bunları Starlette'nin CORS dokümantasyonunda belirtildiği gibi `expose_headers` parametresini kullanarak CORS yapılandırmalarınıza eklemeniz gerekir (daha fazlasını [CORS (Cross-Origin Resource Sharing)](../tutorial/cors.md){.internal-link target=_blank} sayfasında okuyabilirsiniz),.