Search Options

Results per page
Sort
Preferred Languages
Advance

Results 21 - 30 of 694 for statusFn (0.09 sec)

  1. docs/de/docs/advanced/additional-status-codes.md

    **FastAPI** bietet dieselben `starlette.responses` auch via `fastapi.responses` an, als Annehmlichkeit für Sie, den Entwickler. Die meisten verfügbaren Responses kommen aber direkt von Starlette. Das Gleiche gilt für `status`.
    
    ///
    
    ## OpenAPI- und API-Dokumentation
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 2.9K bytes
    - Viewed (0)
  2. docs/zh/docs/advanced/additional-status-codes.md

    ///
    
    /// note | "技术细节"
    
    你也可以使用 `from starlette.responses import JSONResponse`。 
    
    出于方便,**FastAPI** 为开发者提供同 `starlette.responses` 一样的 `fastapi.responses`。但是大多数可用的响应都是直接来自 Starlette。`status` 也是一样。
    
    ///
    
    ## OpenAPI 和 API 文档
    
    如果你直接返回额外的状态码和响应,它们不会包含在 OpenAPI 方案(API 文档)中,因为 FastAPI 没办法预先知道你要返回什么。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  3. docs/zh/docs/advanced/response-change-status-code.md

    # 响应 - 更改状态码
    
    你可能之前已经了解到,你可以设置默认的[响应状态码](../tutorial/response-status-code.md){.internal-link target=_blank}。
    
    但在某些情况下,你需要返回一个不同于默认值的状态码。
    
    ## 使用场景
    
    例如,假设你想默认返回一个HTTP状态码为“OK”`200`。
    
    但如果数据不存在,你想创建它,并返回一个HTTP状态码为“CREATED”`201`。
    
    但你仍然希望能够使用`response_model`过滤和转换你返回的数据。
    
    对于这些情况,你可以使用一个`Response`参数。
    
    ## 使用 `Response` 参数
    
    你可以在你的*路径操作函数*中声明一个`Response`类型的参数(就像你可以为cookies和头部做的那样)。
    
    然后你可以在这个*临时*响应对象中设置`status_code`。
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.4K bytes
    - Viewed (0)
  4. docs/de/docs/advanced/response-change-status-code.md

    # Response – Statuscode ändern
    
    Sie haben wahrscheinlich schon vorher gelesen, dass Sie einen Standard-[Response-Statuscode](../tutorial/response-status-code.md){.internal-link target=_blank} festlegen können.
    
    In manchen Fällen müssen Sie jedoch einen anderen als den Standard-Statuscode zurückgeben.
    
    ## Anwendungsfall
    
    Stellen Sie sich zum Beispiel vor, Sie möchten standardmäßig den HTTP-Statuscode „OK“ `200` zurückgeben.
    
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 06 20:36:54 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  5. docs/ko/docs/advanced/response-change-status-code.md

    # 응답 - 상태 코드 변경
    
    기본 [응답 상태 코드 설정](../tutorial/response-status-code.md){.internal-link target=_blank}이 가능하다는 걸 이미 알고 계실 겁니다.
    
    하지만 경우에 따라 기본 설정과 다른 상태 코드를 반환해야 할 때가 있습니다.
    
    ## 사용 예
    
    예를 들어 기본적으로 HTTP 상태 코드 "OK" `200`을 반환하고 싶다고 가정해 봅시다.
    
    하지만 데이터가 존재하지 않으면 이를 새로 생성하고, HTTP 상태 코드 "CREATED" `201`을 반환하고자 할 때가 있을 수 있습니다.
    
    이때도 여전히 `response_model`을 사용하여 반환하는 데이터를 필터링하고 변환하고 싶을 수 있습니다.
    
    이런 경우에는 `Response` 파라미터를 사용할 수 있습니다.
    
    ## `Response` 파라미터 사용하기
    Registered: Sun Nov 03 07:19:11 UTC 2024
    - Last Modified: Sun Oct 27 22:01:39 UTC 2024
    - 1.8K bytes
    - Viewed (0)
  6. cmd/bucket-handlers_test.go

    			expectedRespStatus: http.StatusOK,
    		},
    		// Test case - 2.
    		// Delete deleted objects with quiet flag off.
    		2: {
    			bucket:             bucketName,
    			objects:            successRequest0,
    			accessKey:          credentials.AccessKey,
    			secretKey:          credentials.SecretKey,
    			expectedContent:    encodedSuccessResponse0,
    			expectedRespStatus: http.StatusOK,
    		},
    		// Test case - 3.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:50:49 UTC 2024
    - 39.8K bytes
    - Viewed (0)
  7. cmd/object-lambda-handlers.go

    func fwdStatusToAPIError(resp *http.Response) *APIError {
    	if status := resp.Header.Get(xhttp.AmzFwdStatus); status != "" && StatusCode(status) > -1 {
    		apiErr := &APIError{
    			HTTPStatusCode: StatusCode(status),
    			Description:    resp.Header.Get(xhttp.AmzFwdErrorMessage),
    			Code:           resp.Header.Get(xhttp.AmzFwdErrorCode),
    		}
    		if apiErr.HTTPStatusCode == http.StatusOK {
    			return nil
    		}
    		return apiErr
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 22 07:04:48 UTC 2024
    - 10.3K bytes
    - Viewed (0)
  8. cmd/bucket-replication-utils.go

    func (rs *ReplicationState) Equal(o ReplicationState) bool {
    	return rs.ReplicaStatus == o.ReplicaStatus &&
    		rs.ReplicationStatusInternal == o.ReplicationStatusInternal &&
    		rs.VersionPurgeStatusInternal == o.VersionPurgeStatusInternal
    }
    
    // CompositeReplicationStatus returns overall replication status for the object version being replicated.
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jun 10 15:31:51 UTC 2024
    - 26.3K bytes
    - Viewed (0)
  9. cmd/crossdomain-xml-handler_test.go

    	srv := httptest.NewServer(handler)
    
    	resp, err := http.Get(srv.URL + crossDomainXMLEntity)
    	if err != nil {
    		t.Fatal(err)
    	}
    	if resp.StatusCode != http.StatusOK {
    		t.Fatal("Unexpected http status received", resp.Status)
    	}
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Sat Jul 08 14:31:42 UTC 2023
    - 1.3K bytes
    - Viewed (0)
  10. cmd/server_test.go

    	c.Assert(err, nil)
    	// execute the HTTP request initiating the new multipart upload.
    	response, err = s.client.Do(request)
    	c.Assert(err, nil)
    	// expecting the response status code to be http.StatusOK(200 OK) .
    	c.Assert(response.StatusCode, http.StatusOK)
    
    	// parse the response body and obtain the new upload ID.
    	decoder := xml.NewDecoder(response.Body)
    	newResponse := &InitiateMultipartUploadResponse{}
    
    Registered: Sun Nov 03 19:28:11 UTC 2024
    - Last Modified: Mon Jul 15 16:28:02 UTC 2024
    - 116.3K bytes
    - Viewed (0)
Back to top