Search Options

Display Count
Sort
Preferred Language
Advanced Search

Results 7521 - 7530 of 7,804 for RETURN (0.06 seconds)

  1. docs_src/header_params/tutorial003_py310.py

    from fastapi import FastAPI, Header
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(x_token: list[str] | None = Header(default=None)):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 186 bytes
    - Click Count (0)
  2. tests/test_openapi_route_extensions.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    from inline_snapshot import snapshot
    
    app = FastAPI()
    
    
    @app.get("/", openapi_extra={"x-custom-extension": "value"})
    def route_with_extras():
        return {}
    
    
    client = TestClient(app)
    
    
    def test_get_route():
        response = client.get("/")
        assert response.status_code == 200, response.text
        assert response.json() == {}
    
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Sun Feb 08 10:18:38 GMT 2026
    - 1.2K bytes
    - Click Count (0)
  3. docs/tr/docs/advanced/response-directly.md

    # Doğrudan Bir Response Döndürme { #return-a-response-directly }
    
    **FastAPI** ile bir *path operation* oluşturduğunuzda, normalde ondan herhangi bir veri döndürebilirsiniz: bir `dict`, bir `list`, bir Pydantic model, bir veritabanı modeli vb.
    
    Bir [Response Model](../tutorial/response-model.md) deklare ederseniz, FastAPI veriyi Pydantic kullanarak JSON'a serialize etmek için bunu kullanır.
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 07:53:17 GMT 2026
    - 4.6K bytes
    - Click Count (0)
  4. tests/test_no_swagger_ui_redirect.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI(swagger_ui_oauth2_redirect_url=None)
    
    
    @app.get("/items/")
    async def read_items():
        return {"id": "foo"}
    
    
    client = TestClient(app)
    
    
    def test_swagger_ui():
        response = client.get("/docs")
        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 786 bytes
    - Click Count (0)
  5. docs_src/custom_response/tutorial006b_py310.py

    from fastapi import FastAPI
    from fastapi.responses import RedirectResponse
    
    app = FastAPI()
    
    
    @app.get("/fastapi", response_class=RedirectResponse)
    async def redirect_fastapi():
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 220 bytes
    - Click Count (0)
  6. docs_src/query_params_str_validations/tutorial012_py310.py

    from fastapi import FastAPI, Query
    
    app = FastAPI()
    
    
    @app.get("/items/")
    async def read_items(q: list[str] = Query(default=["foo", "bar"])):
        query_items = {"q": q}
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 192 bytes
    - Click Count (0)
  7. docs_src/behind_a_proxy/tutorial002_py310.py

    from fastapi import FastAPI, Request
    
    app = FastAPI(root_path="/api/v1")
    
    
    @app.get("/app")
    def read_main(request: Request):
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 208 bytes
    - Click Count (0)
  8. docs_src/app_testing/tutorial001_py310.py

    from fastapi import FastAPI
    from fastapi.testclient import TestClient
    
    app = FastAPI()
    
    
    @app.get("/")
    async def read_main():
        return {"msg": "Hello World"}
    
    
    client = TestClient(app)
    
    
    def test_read_main():
        response = client.get("/")
        assert response.status_code == 200
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Thu Feb 12 13:19:43 GMT 2026
    - 334 bytes
    - Click Count (0)
  9. docs/zh/docs/tutorial/response-model.md

    因此,**FastAPI** 会负责过滤掉输出模型中未声明的所有数据(使用 Pydantic)。
    
    ### `response_model` 还是返回类型 { #response-model-or-return-type }
    
    在这个例子中,因为两个模型不同,如果我们将函数返回类型注解为 `UserOut`,编辑器和工具会抱怨我们返回了无效类型,因为它们是不同的类。
    
    这就是为什么在这个例子里我们必须在 `response_model` 参数中声明它。
    
    ……但继续往下读,看看如何更好地处理这种情况。
    
    ## 返回类型与数据过滤 { #return-type-and-data-filtering }
    
    延续上一个例子。我们希望**用一种类型来注解函数**,但希望从函数返回的内容实际上可以**包含更多数据**。
    
    Created: Sun Apr 05 07:19:11 GMT 2026
    - Last Modified: Fri Mar 20 17:06:37 GMT 2026
    - 14.5K bytes
    - Click Count (0)
  10. clause/delete.go

    package clause
    
    type Delete struct {
    	Modifier string
    }
    
    func (d Delete) Name() string {
    	return "DELETE"
    }
    
    func (d Delete) Build(builder Builder) {
    	builder.WriteString("DELETE")
    
    	if d.Modifier != "" {
    		builder.WriteByte(' ')
    		builder.WriteString(d.Modifier)
    	}
    }
    
    func (d Delete) MergeClause(clause *Clause) {
    	clause.Name = ""
    	clause.Expression = d
    Created: Sun Apr 05 09:35:12 GMT 2026
    - Last Modified: Mon Mar 09 09:07:00 GMT 2020
    - 359 bytes
    - Click Count (0)
Back to Top