Search Options

Results per page
Sort
Preferred Languages
Advance

Results 91 - 100 of 1,008 for example (0.24 sec)

  1. docs/en/docs/tutorial/handling-errors.md

    In this example, when the client requests an item by an ID that doesn't exist, raise an exception with a status code of `404`:
    
    ```Python hl_lines="11"
    {!../../../docs_src/handling_errors/tutorial001.py!}
    ```
    
    ### The resulting response
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 9.1K bytes
    - Viewed (0)
  2. docs/en/docs/advanced/events.md

    ## Use Case
    
    Let's start with an example **use case** and then see how to solve it with this.
    
    Let's imagine that you have some **machine learning models** that you want to use to handle requests. 🤖
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  3. common-protos/k8s.io/api/admission/v1/generated.proto

      optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionKind kind = 2;
    
      // Resource is the fully-qualified resource being requested (for example, v1.pods)
      optional k8s.io.apimachinery.pkg.apis.meta.v1.GroupVersionResource resource = 3;
    
      // SubResource is the subresource being requested, if any (for example, "status" or "scale")
      // +optional
    Plain Text
    - Registered: Wed May 08 22:53:08 GMT 2024
    - Last Modified: Mon Mar 11 18:43:24 GMT 2024
    - 8.1K bytes
    - Viewed (0)
  4. tests/test_tutorial/test_schema_extra_example/test_tutorial004_an_py310.py

    from ...utils import needs_py310
    
    
    @pytest.fixture(name="client")
    def get_client():
        from docs_src.schema_extra_example.tutorial004_an_py310 import app
    
        client = TestClient(app)
        return client
    
    
    # Test required and embedded body parameters with no bodies sent
    @needs_py310
    def test_post_body_example(client: TestClient):
        response = client.put(
            "/items/5",
            json={
                "name": "Foo",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 7.1K bytes
    - Viewed (0)
  5. okhttp/src/test/java/okhttp3/UrlComponentEncodingTester.kt

        open fun encode(codePoint: Int): String {
          throw UnsupportedOperationException()
        }
      }
    
      enum class Component {
        USER {
          override fun urlString(value: String): String = "http://$value@example.com/"
    
          override fun encodedValue(url: HttpUrl): String = url.encodedUsername
    
          override operator fun set(
            builder: HttpUrl.Builder,
            value: String,
          ) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 12.3K bytes
    - Viewed (0)
  6. docs/en/docs/deployment/https.md

    ### Multiple Applications
    
    In the same server (or servers), there could be **multiple applications**, for example, other API programs or a database.
    
    Only one process can be handling the specific IP and port (the TLS Termination Proxy in our example) but the other applications/processes can be running on the server(s) too, as long as they don't try to use the same **combination of public IP and port**.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Jan 11 16:31:18 GMT 2024
    - 12K bytes
    - Viewed (0)
  7. docs/en/docs/tutorial/body-updates.md

    * Convert the copied model to something that can be stored in your DB (for example, using the `jsonable_encoder`).
        * This is comparable to using the model's `.model_dump()` method again, but it makes sure (and converts) the values to data types that can be converted to JSON, for example, `datetime` to `str`.
    * Save the data to your DB.
    * Return the updated model.
    
    === "Python 3.10+"
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  8. fastapi/security/oauth2.py

        Read more about it in the
        [FastAPI docs for Simple OAuth2 with Password and Bearer](https://fastapi.tiangolo.com/tutorial/security/simple-oauth2/).
    
        ## Example
    
        ```python
        from typing import Annotated
    
        from fastapi import Depends, FastAPI
        from fastapi.security import OAuth2PasswordRequestForm
    
        app = FastAPI()
    
    
        @app.post("/login")
    Python
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 21.1K bytes
    - Viewed (1)
  9. docs/en/docs/tutorial/encoder.md

    For example, if you need to store it in a database.
    
    For that, **FastAPI** provides a `jsonable_encoder()` function.
    
    ## Using the `jsonable_encoder`
    
    Let's imagine that you have a database `fake_db` that only receives JSON compatible data.
    
    For example, it doesn't receive `datetime` objects, as those are not compatible with JSON.
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Tue Oct 17 05:59:11 GMT 2023
    - 1.8K bytes
    - Viewed (0)
  10. docs/en/docs/how-to/configure-swagger-ui.md

    FastAPI converts the configurations to **JSON** to make them compatible with JavaScript, as that's what Swagger UI needs.
    
    ## Disable Syntax Highlighting
    
    For example, you could disable syntax highlighting in Swagger UI.
    
    Without changing the settings, syntax highlighting is enabled by default:
    
    <img src="/img/tutorial/extending-openapi/image02.png">
    
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.8K bytes
    - Viewed (0)
Back to top