Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 106 for host (0.14 sec)

  1. docs_src/using_request_directly/tutorial001.py

    from fastapi import FastAPI, Request
    
    app = FastAPI()
    
    
    @app.get("/items/{item_id}")
    def read_root(item_id: str, request: Request):
        client_host = request.client.host
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 230 bytes
    - Viewed (0)
  2. configure.py

          environ_cp,
          var_name='GCC_HOST_COMPILER_PATH',
          var_default=default_gcc_host_compiler_path,
          ask_for_var='Please specify which gcc should be used by nvcc as the host '
          'compiler.',
          check_success=os.path.exists,
          resolve_symlinks=True,
          error_msg='Invalid gcc path. %s cannot be found.',
      )
    
      write_action_env_to_bazelrc('GCC_HOST_COMPILER_PATH', gcc_host_compiler_path)
    
    
    Python
    - Registered: Tue Apr 23 12:39:09 GMT 2024
    - Last Modified: Mon Apr 15 18:25:36 GMT 2024
    - 53.8K bytes
    - Viewed (0)
  3. docs_src/debugging/tutorial001.py

    import uvicorn
    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def root():
        a = "a"
        b = "b" + a
        return {"hello world": b}
    
    
    if __name__ == "__main__":
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 223 bytes
    - Viewed (0)
  4. docs/sts/client-grants.py

    with open('/etc/hosts', 'rb') as data:
        s3.meta.client.upload_fileobj(data,
                                      'testbucket',
                                      'hosts',
                                      ExtraArgs={'ServerSideEncryption': 'AES256'})
    
    # Upload with server side encryption, using temporary credentials
    s3.meta.client.upload_file('/etc/hosts',
                               'testbucket',
    Python
    - Registered: Sun Apr 21 19:28:08 GMT 2024
    - Last Modified: Fri Apr 23 18:58:53 GMT 2021
    - 1.2K bytes
    - Viewed (0)
  5. fastapi/applications.py

                    * `url`: A URL to the target host. This URL supports Server Variables
                    and MAY be relative, to indicate that the host location is relative
                    to the location where the OpenAPI document is being served. Variable
                    substitutions will be made when a variable is named in `{`brackets`}`.
                    * `description`: An optional string describing the host designated by
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 172.2K bytes
    - Viewed (0)
  6. tests/test_generate_unique_id_function.py

        app = FastAPI(generate_unique_id_function=broken_operation_id)
    
        @app.post("/")
        def post_root(item1: Item):
            return item1  # pragma: nocover
    
        @app.post("/second")
        def post_second(item1: Item):
            return item1  # pragma: nocover
    
        @app.post("/third")
        def post_third(item1: Item):
            return item1  # pragma: nocover
    
        client = TestClient(app)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Sat Jan 13 15:10:26 GMT 2024
    - 66.7K bytes
    - Viewed (0)
  7. tests/test_tutorial/test_request_files/test_tutorial001_02_py310.py

        client = TestClient(app)
        return client
    
    
    @needs_py310
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    @needs_py310
    def test_post_uploadfile_no_body(client: TestClient):
        response = client.post("/uploadfile/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.5K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_request_files/test_tutorial001_02.py

    from docs_src.request_files.tutorial001_02 import app
    
    client = TestClient(app)
    
    
    def test_post_form_no_body():
        response = client.post("/files/")
        assert response.status_code == 200, response.text
        assert response.json() == {"message": "No file sent"}
    
    
    def test_post_uploadfile_no_body():
        response = client.post("/uploadfile/")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri Jul 07 17:12:13 GMT 2023
    - 8.2K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_request_files/test_tutorial001_an_py39.py

        )
    
    
    @needs_py39
    def test_post_file(tmp_path, client: TestClient):
        path = tmp_path / "test.txt"
        path.write_bytes(b"<file content>")
    
        with path.open("rb") as file:
            response = client.post("/files/", files={"file": file})
        assert response.status_code == 200, response.text
        assert response.json() == {"file_size": 14}
    
    
    @needs_py39
    def test_post_large_file(tmp_path, client: TestClient):
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial002_an_py39.py

        return app
    
    
    @pytest.fixture(name="client")
    def get_client(app: FastAPI):
        client = TestClient(app)
        return client
    
    
    @needs_py39
    def test_post_form_no_body(client: TestClient):
        response = client.post("/files/")
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.9K bytes
    - Viewed (0)
Back to top