Search Options

Results per page
Sort
Preferred Languages
Advance

Results 311 - 320 of 1,758 for Request (0.06 sec)

  1. tests/test_tutorial/test_custom_request_and_route/test_tutorial001.py

    import gzip
    import json
    
    import pytest
    from fastapi import Request
    from fastapi.testclient import TestClient
    
    from docs_src.custom_request_and_route.tutorial001 import app
    
    
    @app.get("/check-class")
    async def check_gzip_request(request: Request):
        return {"request_class": type(request).__name__}
    
    
    client = TestClient(app)
    
    
    @pytest.mark.parametrize("compress", [True, False])
    def test_gzip_request(compress):
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Nov 13 14:26:09 UTC 2022
    - 886 bytes
    - Viewed (0)
  2. docs/zh/docs/tutorial/middleware.md

    如果你使用了 `yield` 关键字依赖, 依赖中的退出代码将在执行中间件*后*执行.
    
    如果有任何后台任务(稍后记录), 它们将在执行中间件*后*运行.
    
    ///
    
    ## 创建中间件
    
    要创建中间件你可以在函数的顶部使用装饰器 `@app.middleware("http")`.
    
    中间件参数接收如下参数:
    
    * `request`.
    * 一个函数 `call_next` 它将接收 `request` 作为参数.
        * 这个函数将 `request` 传递给相应的 *路径操作*.
        * 然后它将返回由相应的*路径操作*生成的 `response`.
    * 然后你可以在返回 `response` 前进一步修改它.
    
    ```Python hl_lines="8-9  11  14"
    {!../../docs_src/middleware/tutorial001.py!}
    ```
    
    /// tip
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.7K bytes
    - Viewed (0)
  3. api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyCoordinatesFactory.java

        /**
         * Creates a new {@link DependencyCoordinates} object from the request.
         *
         * @param request the request containing the various data
         * @return a new {@link DependencyCoordinates} object
         *
         * @throws IllegalArgumentException if {@code request} is null or
         *         if {@code request.getSession()} is null or invalid
         */
        @Nonnull
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Tue Aug 27 21:13:34 UTC 2024
    - 3.4K bytes
    - Viewed (0)
  4. docs_src/handling_errors/tutorial005.py

    from fastapi import FastAPI, Request, status
    from fastapi.encoders import jsonable_encoder
    from fastapi.exceptions import RequestValidationError
    from fastapi.responses import JSONResponse
    from pydantic import BaseModel
    
    app = FastAPI()
    
    
    @app.exception_handler(RequestValidationError)
    async def validation_exception_handler(request: Request, exc: RequestValidationError):
        return JSONResponse(
            status_code=status.HTTP_422_UNPROCESSABLE_ENTITY,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 667 bytes
    - Viewed (0)
  5. compat/maven-compat/src/test/java/org/apache/maven/AbstractCoreMavenComponentTestCase.java

                throws Exception {
            MavenExecutionRequest request = createMavenExecutionRequest(pom);
    
            ProjectBuildingRequest configuration = new DefaultProjectBuildingRequest()
                    .setLocalRepository(request.getLocalRepository())
                    .setRemoteRepositories(request.getRemoteRepositories())
                    .setPluginArtifactRepositories(request.getPluginArtifactRepositories())
    Registered: Sun Nov 03 03:35:11 UTC 2024
    - Last Modified: Fri Oct 25 12:31:46 UTC 2024
    - 12.1K bytes
    - Viewed (0)
  6. src/main/java/org/codelibs/fess/helper/UserAgentHelper.java

        public UserAgentType getUserAgentType() {
            return LaRequestUtil.getOptionalRequest().map(request -> {
                UserAgentType uaType = (UserAgentType) request.getAttribute(USER_AGENT_TYPE);
                if (uaType == null) {
                    final String userAgent = request.getHeader(USER_AGENT);
                    if (userAgent != null) {
    Registered: Thu Oct 31 13:40:30 UTC 2024
    - Last Modified: Thu Feb 22 01:37:57 UTC 2024
    - 2.2K bytes
    - Viewed (0)
  7. docs_src/handling_errors/tutorial003.py

    from fastapi import FastAPI, Request
    from fastapi.responses import JSONResponse
    
    
    class UnicornException(Exception):
        def __init__(self, name: str):
            self.name = name
    
    
    app = FastAPI()
    
    
    @app.exception_handler(UnicornException)
    async def unicorn_exception_handler(request: Request, exc: UnicornException):
        return JSONResponse(
            status_code=418,
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Thu Mar 26 19:09:53 UTC 2020
    - 626 bytes
    - Viewed (0)
  8. cmd/dummy-handlers.go

    func (api objectAPIHandlers) DeleteBucketWebsiteHandler(w http.ResponseWriter, r *http.Request) {
    	writeSuccessResponseHeadersOnly(w)
    }
    
    // GetBucketCorsHandler - GET bucket cors, a dummy api
    func (api objectAPIHandlers) GetBucketCorsHandler(w http.ResponseWriter, r *http.Request) {
    	ctx := newContext(r, w, "GetBucketCors")
    
    	defer logger.AuditLog(ctx, w, r, mustGetClaimsFromToken(r))
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Tue Aug 13 15:25:16 UTC 2024
    - 8.8K bytes
    - Viewed (0)
  9. common-protos/k8s.io/api/authentication/v1beta1/generated.proto

      repeated string items = 1;
    }
    
    // SelfSubjectReview contains the user information that the kube-apiserver has about the user making this request.
    // When using impersonation, users will receive the user info of the user being impersonated.  If impersonation or
    // request header authentication is used, any extra keys will have their case ignored and returned as lowercase.
    message SelfSubjectReview {
      // Standard object's metadata.
    Registered: Wed Nov 06 22:53:10 UTC 2024
    - Last Modified: Mon Mar 11 18:43:24 UTC 2024
    - 5.2K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/internal/ws/WebSocketHttpTest.kt

        closeWebSockets(webSocket, server)
      }
    
      private fun newWebSocket(
        request: Request =
          Request.Builder().get().url(
            webServer.url("/"),
          ).build(),
      ): RealWebSocket {
        val webSocket =
          RealWebSocket(
            TaskRunner.INSTANCE,
            request,
            clientListener,
            random,
            client.pingIntervalMillis.toLong(),
            null,
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Sun Mar 31 17:16:15 UTC 2024
    - 35.2K bytes
    - Viewed (0)
Back to top