Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 16 for origin (0.17 sec)

  1. fastapi/_compat.py

            return True
        origin = get_origin(annotation)
        if origin is Union or origin is UnionType:
            for arg in get_args(annotation):
                if lenient_issubclass(arg, UploadFile):
                    return True
        return False
    
    
    def is_bytes_sequence_annotation(annotation: Any) -> bool:
        origin = get_origin(annotation)
        if origin is Union or origin is UnionType:
            at_least_one = False
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 22.6K bytes
    - Viewed (0)
  2. tests/test_tutorial/test_cors/test_tutorial001.py

        headers = {
            "Origin": "https://localhost.tiangolo.com",
            "Access-Control-Request-Method": "GET",
            "Access-Control-Request-Headers": "X-Example",
        }
        response = client.options("/", headers=headers)
        assert response.status_code == 200, response.text
        assert response.text == "OK"
        assert (
            response.headers["access-control-allow-origin"]
            == "https://localhost.tiangolo.com"
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Jul 09 18:06:12 GMT 2020
    - 1.2K bytes
    - Viewed (0)
  3. tests/test_custom_swagger_ui_redirect.py

        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
        print(client.base_url)
        assert (
            f"oauth2RedirectUrl: window.location.origin + '{swagger_ui_oauth2_redirect_url}'"
            in response.text
        )
    
    
    def test_swagger_ui_oauth2_redirect():
        response = client.get(swagger_ui_oauth2_redirect_url)
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Wed Apr 08 04:37:38 GMT 2020
    - 1.1K bytes
    - Viewed (0)
  4. fastapi/openapi/docs.py

        for key, value in current_swagger_ui_parameters.items():
            html += f"{json.dumps(key)}: {json.dumps(jsonable_encoder(value))},\n"
    
        if oauth2_redirect_url:
            html += f"oauth2RedirectUrl: window.location.origin + '{oauth2_redirect_url}',"
    
        html += """
        presets: [
            SwaggerUIBundle.presets.apis,
            SwaggerUIBundle.SwaggerUIStandalonePreset
            ],
        })"""
    
        if init_oauth:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Apr 02 02:48:51 GMT 2024
    - 10.1K bytes
    - Viewed (0)
  5. configure.py

              'Current value is %s.' %
              (var_name, ', '.join(true_strings), ', '.join(false_strings), var))
    
      while var is None:
        user_input_origin = get_input(question)
        user_input = user_input_origin.strip().lower()
        if user_input == 'y':
          print(yes_reply)
          var = True
        elif user_input == 'n':
          print(no_reply)
          var = False
        elif not user_input:
    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)
  6. .github/actions/people/app/main.py

        message = "👥 Update FastAPI People"
        result = subprocess.run(["git", "commit", "-m", message], check=True)
        logging.info("Pushing branch")
        subprocess.run(["git", "push", "origin", branch_name], check=True)
        logging.info("Creating PR")
        pr = repo.create_pull(title=message, body=message, base="master", head=branch_name)
        logging.info(f"Created PR: {pr.number}")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Tue Mar 26 17:38:21 GMT 2024
    - 19.2K bytes
    - Viewed (1)
  7. tests/test_application.py

        assert response.status_code == 200, response.text
        assert response.headers["content-type"] == "text/html; charset=utf-8"
        assert "swagger-ui-dist" in response.text
        assert (
            "oauth2RedirectUrl: window.location.origin + '/docs/oauth2-redirect'"
            in response.text
        )
    
    
    def test_swagger_ui_oauth2_redirect():
        response = client.get("/docs/oauth2-redirect")
        assert response.status_code == 200, response.text
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  8. docs_src/cors/tutorial001.py

    from fastapi import FastAPI
    from fastapi.middleware.cors import CORSMiddleware
    
    app = FastAPI()
    
    origins = [
        "http://localhost.tiangolo.com",
        "https://localhost.tiangolo.com",
        "http://localhost",
        "http://localhost:8080",
    ]
    
    app.add_middleware(
        CORSMiddleware,
        allow_origins=origins,
        allow_credentials=True,
        allow_methods=["*"],
        allow_headers=["*"],
    )
    
    
    @app.get("/")
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Mar 26 19:09:53 GMT 2020
    - 459 bytes
    - Viewed (0)
  9. fastapi/utils.py

        original_type = field.type_
        if is_dataclass(original_type) and hasattr(original_type, "__pydantic_model__"):
            original_type = original_type.__pydantic_model__
        use_type = original_type
        if lenient_issubclass(original_type, BaseModel):
            original_type = cast(Type[BaseModel], original_type)
            use_type = cloned_types.get(original_type)
            if use_type is None:
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.8K bytes
    - Viewed (0)
  10. docs_src/custom_request_and_route/tutorial001.py

            return self._body
    
    
    class GzipRoute(APIRoute):
        def get_route_handler(self) -> Callable:
            original_route_handler = super().get_route_handler()
    
            async def custom_route_handler(request: Request) -> Response:
                request = GzipRequest(request.scope, request.receive)
                return await original_route_handler(request)
    
            return custom_route_handler
    
    
    app = FastAPI()
    Python
    - Registered: Sun Apr 21 07:19:11 GMT 2024
    - Last Modified: Fri May 13 23:38:22 GMT 2022
    - 973 bytes
    - Viewed (0)
Back to top