- Sort Score
- Result 10 results
- Languages All
Results 381 - 390 of 1,430 for responses (0.06 sec)
-
tests/test_security_http_bearer.py
response = client.get("/users/me", headers={"Authorization": "Basic notreally"}) assert response.status_code == 403, response.text assert response.json() == {"detail": "Invalid authentication credentials"} def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_security_http_digest_description.py
def test_security_http_digest(): response = client.get("/users/me", headers={"Authorization": "Digest foobar"}) assert response.status_code == 200, response.text assert response.json() == {"scheme": "Digest", "credentials": "foobar"} def test_security_http_digest_no_credentials(): response = client.get("/users/me") assert response.status_code == 403, response.text
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.2K bytes - Viewed (0) -
docs_src/custom_response/tutorial001b.py
from fastapi import FastAPI from fastapi.responses import ORJSONResponse app = FastAPI() @app.get("/items/", response_class=ORJSONResponse) async def read_items():
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Thu Sep 01 09:59:05 UTC 2022 - 215 bytes - Viewed (0) -
tests/test_security_api_key_header_description.py
client = TestClient(app) def test_security_api_key(): response = client.get("/users/me", headers={"key": "secret"}) assert response.status_code == 200, response.text assert response.json() == {"username": "secret"} def test_security_api_key_no_key(): response = client.get("/users/me") assert response.status_code == 403, response.text assert response.json() == {"detail": "Not authenticated"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2K bytes - Viewed (0) -
tests/test_tutorial/test_extra_data_types/test_tutorial001_an.py
"item_id": item_id, } ) response = client.put(f"/items/{item_id}", json=data) assert response.status_code == 200, response.text assert response.json() == expected_response def test_openapi_schema(): response = client.get("/openapi.json") assert response.status_code == 200, response.text assert response.json() == { "openapi": "3.1.0",
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Apr 19 00:11:40 UTC 2024 - 6.8K bytes - Viewed (0) -
tests/test_tutorial/test_query_params_str_validations/test_tutorial014.py
client = TestClient(app) def test_hidden_query(): response = client.get("/items?hidden_query=somevalue") assert response.status_code == 200, response.text assert response.json() == {"hidden_query": "somevalue"} def test_no_hidden_query(): response = client.get("/items") assert response.status_code == 200, response.text assert response.json() == {"hidden_query": "Not found"}
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 2.9K bytes - Viewed (0) -
samples/guide/src/main/java/okhttp3/recipes/RewriteResponseCacheControl.java
} else { System.out.println("Force cache: false"); clientForCall = client; } try (Response response = clientForCall.newCall(request).execute()) { if (!response.isSuccessful()) throw new IOException("Unexpected code " + response); System.out.println(" Network: " + (response.networkResponse() != null)); System.out.println(); } } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Sat Jan 12 03:31:36 UTC 2019 - 2.6K bytes - Viewed (0) -
tests/test_param_in_path_and_dependency.py
async def read_users(user_id: int): pass client = TestClient(app) def test_read_users(): response = client.get("/users/42") assert response.status_code == 200, response.text def test_openapi_schema(): response = client.get("/openapi.json") data = response.json() assert data == { "openapi": "3.1.0", "info": {"title": "FastAPI", "version": "0.1.0"},
Registered: Sun Nov 03 07:19:11 UTC 2024 - Last Modified: Fri Jun 30 18:25:16 UTC 2023 - 3.1K bytes - Viewed (0) -
okhttp/src/test/java/okhttp3/CacheTest.kt
.build() val response1 = client.newCall(request).execute() response1.body.close() assertThat(response1.header("X-Response-ID")).isEqualTo("1") val response2 = get(url) response2.body.close() if (expectCached) { assertThat(response2.header("X-Response-ID")).isEqualTo("1") } else { assertThat(response2.header("X-Response-ID")).isEqualTo("2") } }
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Wed Apr 10 19:46:48 UTC 2024 - 108.6K bytes - Viewed (0) -
okhttp-dnsoverhttps/src/main/kotlin/okhttp3/dnsoverhttps/DnsOverHttps.kt
hostname: String, response: Response, ): List<InetAddress> { if (response.cacheResponse == null && response.protocol !== Protocol.HTTP_2 && response.protocol !== Protocol.QUIC) { Platform.get().log("Incorrect protocol: ${response.protocol}", Platform.WARN) } response.use { if (!response.isSuccessful) { throw IOException("response: " + response.code + " " + response.message)
Registered: Fri Nov 01 11:42:11 UTC 2024 - Last Modified: Thu Oct 31 09:27:31 UTC 2024 - 9.8K bytes - Viewed (0)