Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 339 for Turing (0.21 sec)

  1. docs/zh/docs/advanced/using-request-directly.md

    不过,仍可以验证、转换与注释(使用 Pydantic 模型的请求体等)其它正常声明的参数。
    
    但在某些特定情况下,还是需要提取 `Request` 对象。
    
    ## 直接使用 `Request` 对象
    
    假设要在*路径操作函数*中获取客户端 IP 地址和主机。
    
    此时,需要直接访问请求。
    
    ```Python hl_lines="1  7-8"
    {!../../../docs_src/using_request_directly/tutorial001.py!}
    ```
    
    把*路径操作函数*的参数类型声明为 `Request`,**FastAPI** 就能把 `Request` 传递到参数里。
    
    !!! tip "提示"
    
        注意,本例除了声明请求参数之外,还声明了路径参数。
    
        因此,能够提取、验证路径参数、并转换为指定类型,还可以用 OpenAPI 注释。
    
    Plain Text
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Mar 30 22:44:02 GMT 2024
    - 2K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_query_params_str_validations/test_tutorial010_an.py

                                        "maxLength": 50,
                                        "minLength": 3,
                                        "pattern": "^fixedquery$",
                                        "type": "string",
                                        "description": "Query string for the items to search in the database that have a good match",
                                    }
                                ),
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 6.2K bytes
    - Viewed (0)
  3. tests/test_tutorial/test_body_updates/test_tutorial001_py39.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Sep 28 04:14:40 GMT 2023
    - 11.8K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_security/test_tutorial005_an.py

                                    "type": "string",
                                }
                            ),
                            "username": {"title": "Username", "type": "string"},
                            "password": {"title": "Password", "type": "string"},
                            "scope": {"title": "Scope", "type": "string", "default": ""},
                            "client_id": IsDict(
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 15.4K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_extra_data_types/test_tutorial001.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Apr 19 00:11:40 GMT 2024
    - 6.8K bytes
    - Viewed (0)
  6. tests/test_tutorial/test_extra_models/test_tutorial003_py310.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                    "HTTPValidationError": {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Aug 04 20:47:07 GMT 2023
    - 5.3K bytes
    - Viewed (0)
  7. tests/test_include_router_defaults_overrides.py

                                "items": {
                                    "anyOf": [{"type": "string"}, {"type": "integer"}]
                                },
                            },
                            "msg": {"title": "Message", "type": "string"},
                            "type": {"title": "Error Type", "type": "string"},
                        },
                    },
                }
            },
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 358.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_additional_responses/test_tutorial001.py

                            "id": {"title": "Id", "type": "string"},
                            "value": {"title": "Value", "type": "string"},
                        },
                    },
                    "Message": {
                        "title": "Message",
                        "required": ["message"],
                        "type": "object",
                        "properties": {"message": {"title": "Message", "type": "string"}},
                    },
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 4.3K bytes
    - Viewed (0)
  9. fastapi/security/oauth2.py

            This dependency is strict about it. If you want to be permissive, use instead the
            OAuth2PasswordRequestForm dependency class.
        username: username string. The OAuth2 spec requires the exact field name "username".
        password: password string. The OAuth2 spec requires the exact field name "password".
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  10. tests/test_tutorial/test_additional_responses/test_tutorial003.py

                            "id": {"title": "Id", "type": "string"},
                            "value": {"title": "Value", "type": "string"},
                        },
                    },
                    "Message": {
                        "title": "Message",
                        "required": ["message"],
                        "type": "object",
                        "properties": {"message": {"title": "Message", "type": "string"}},
                    },
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jun 30 18:25:16 GMT 2023
    - 4.5K bytes
    - Viewed (0)
Back to top