Search Options

Results per page
Sort
Preferred Languages
Advance

Results 11 - 20 of 101 for F401 (0.22 sec)

  1. tests/test_tutorial/test_security/test_tutorial005.py

        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    def test_no_token(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.get("/users/me")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token(mod: ModuleType):
        client = TestClient(mod.app)
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 15.8K bytes
    - Viewed (0)
  2. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourceHttpTest.kt

        server.enqueue(
          MockResponse(
            code = 401,
            body = "{\"error\":{\"message\":\"No auth credentials found\",\"code\":401}}",
            headers = Headers.headersOf("content-type", "application/json"),
          ),
        )
        val source = newEventSource()
        assertThat(source.request().url.encodedPath).isEqualTo("/")
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Tue Nov 04 19:13:52 UTC 2025
    - 8.8K bytes
    - Viewed (0)
  3. docs/en/docs/how-to/authentication-error-status-code.md

    Starting with FastAPI version `0.122.0`, they use the more appropriate HTTP status code `401 Unauthorized`, and return a sensible `WWW-Authenticate` header in the response, following the HTTP specifications, <a href="https://datatracker.ietf.org/doc/html/rfc7235#section-3.1" class="external-link" target="_blank">RFC 7235</a>, <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-401-unauthorized" class="external-link" target="_blank">RFC 9110</a>.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  4. docs/pt/docs/how-to/authentication-error-status-code.md

    A partir da versão `0.122.0` do FastAPI, eles usam o código de status HTTP `401 Unauthorized`, mais apropriado, e retornam um cabeçalho `WWW-Authenticate` adequado na response, seguindo as especificações HTTP, <a href="https://datatracker.ietf.org/doc/html/rfc7235#section-3.1" class="external-link" target="_blank">RFC 7235</a>, <a href="https://datatracker.ietf.org/doc/html/rfc9110#name-401-unauthorized" class="external-link" target="_blank">RFC 9110</a>.
    
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 19:59:04 UTC 2025
    - 1.3K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_security/test_tutorial004.py

        )
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Incorrect username or password"}
    
    
    def test_login_incorrect_username(mod: ModuleType):
        client = TestClient(mod.app)
        response = client.post("/token", data={"username": "foo", "password": "secret"})
        assert response.status_code == 401, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Fri Dec 26 10:43:02 UTC 2025
    - 13.3K bytes
    - Viewed (0)
  6. tests/test_security_http_basic_realm.py

        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.6K bytes
    - Viewed (0)
  7. okhttp-sse/src/test/java/okhttp3/sse/internal/EventSourcesHttpTest.kt

        listener.assertOpen()
        listener.assertFailure("canceled")
      }
    
      @Test
      fun failureWith401IsReadable() {
        server.enqueue(
          MockResponse(
            code = 401,
            body = "{\"error\":{\"message\":\"No auth credentials found\",\"code\":401}}",
            headers = Headers.headersOf("content-type", "application/json"),
          ),
        )
        server.enqueue(
          MockResponse(
            body =
              """
    Registered: Fri Dec 26 11:42:13 UTC 2025
    - Last Modified: Fri Oct 03 07:51:20 UTC 2025
    - 3.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_security/test_tutorial001.py

        client = TestClient(mod.app)
        return client
    
    
    def test_no_token(client: TestClient):
        response = client.get("/items")
        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_token(client: TestClient):
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Wed Dec 17 20:41:43 UTC 2025
    - 2.2K bytes
    - Viewed (0)
  9. tests/test_security_http_basic_realm_description.py

        assert response.status_code == 401, response.text
        assert response.headers["WWW-Authenticate"] == 'Basic realm="simple"'
    
    
    def test_security_http_basic_invalid_credentials():
        response = client.get(
            "/users/me", headers={"Authorization": "Basic notabase64token"}
        )
        assert response.status_code == 401, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Mon Nov 24 19:03:06 UTC 2025
    - 2.7K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_security/test_tutorial003.py

        assert response.status_code == 401, response.text
        assert response.json() == {"detail": "Not authenticated"}
        assert response.headers["WWW-Authenticate"] == "Bearer"
    
    
    def test_incorrect_token_type(client: TestClient):
        response = client.get(
            "/users/me", headers={"Authorization": "Notexistent testtoken"}
        )
        assert response.status_code == 401, response.text
    Registered: Sun Dec 28 07:19:09 UTC 2025
    - Last Modified: Sat Dec 27 18:19:10 UTC 2025
    - 7.7K bytes
    - Viewed (0)
Back to top