Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 406 for json (0.16 sec)

  1. tests/test_application.py

        response = client.get("/enum-status-code")
        assert response.status_code == 201, response.text
        assert response.json() == "foo bar"
    
    
    def test_openapi_schema():
        response = client.get("/openapi.json")
        assert response.status_code == 200, response.text
        assert response.json() == {
            "openapi": "3.1.0",
            "info": {"title": "FastAPI", "version": "0.1.0"},
            "paths": {
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 21:56:59 GMT 2024
    - 52.2K bytes
    - Viewed (0)
  2. docs/ru/docs/tutorial/encoder.md

    Функция не возвращает большой `str`, содержащий данные в формате JSON (в виде строки). Она возвращает стандартную структуру данных Python (например, `dict`) со значениями и подзначениями, которые совместимы с JSON.
    
    !!! note "Технические детали"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 23 13:56:12 GMT 2024
    - 2.8K bytes
    - Viewed (0)
  3. docs/uk/docs/tutorial/encoder.md

    Вона не повертає велику строку `str`, яка містить дані у форматі JSON (як строка). Вона повертає стандартну структуру даних Python (наприклад `dict`) із значеннями та підзначеннями, які є сумісними з JSON.
    
    !!! note "Примітка"
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:53:19 GMT 2024
    - 2.6K bytes
    - Viewed (0)
  4. docs_src/app_testing/app_b/test_main.py

        assert response.status_code == 404
        assert response.json() == {"detail": "Item not found"}
    
    
    def test_create_item():
        response = client.post(
            "/items/",
            headers={"X-Token": "coneofsilence"},
            json={"id": "foobar", "title": "Foo Bar", "description": "The Foo Barters"},
        )
        assert response.status_code == 200
        assert response.json() == {
            "id": "foobar",
            "title": "Foo Bar",
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 1.8K bytes
    - Viewed (0)
  5. tests/test_tutorial/test_sql_databases/test_sql_databases_middleware_py310.py

        test_user = {"email": "******@****.***", "password": "secret"}
        response = client.post("/users/", json=test_user)
        assert response.status_code == 200, response.text
        data = response.json()
        assert test_user["email"] == data["email"]
        assert "id" in data
        response = client.post("/users/", json=test_user)
        assert response.status_code == 400, response.text
    
    
    @needs_py310
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.5K bytes
    - Viewed (0)
  6. docs/zh/docs/advanced/additional-responses.md

    			- 媒体类型的密钥,例如 `application/json` ,它包含另一个`JSON`对象作为值,该对象包含:
    				- 一个键` schema` ,它的值是来自模型的`JSON Schema`,正确的位置在这里。
    					- **FastAPI**在这里添加了对OpenAPI中另一个地方的全局JSON模式的引用,而不是直接包含它。这样,其他应用程序和客户端可以直接使用这些JSON模式,提供更好的代码生成工具等。
    
    
    **在OpenAPI中为该路径操作生成的响应将是:**
    
    ```json hl_lines="3-12"
    {
        "responses": {
            "404": {
                "description": "Additional Response",
                "content": {
                    "application/json": {
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Tue Jan 09 15:53:39 GMT 2024
    - 8.2K bytes
    - Viewed (0)
  7. docs/ru/docs/tutorial/schema-extra-example.md

    Поля `example` как такового не существует в стандартах **JSON Schema**. В последних версиях JSON-схемы определено поле <a href="https://json-schema.org/draft/2019-09/json-schema-validation.html#rfc.section.9.5" class="external-link" target="_blank">`examples`</a>, но OpenAPI 3.0.3 основан на более старой версии JSON-схемы, которая не имела поля `examples`.
    
    Plain Text
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Fri Mar 22 01:42:11 GMT 2024
    - 11.6K bytes
    - Viewed (0)
  8. tests/test_tutorial/test_sql_databases/test_sql_databases.py

        test_user = {"email": "******@****.***", "password": "secret"}
        response = client.post("/users/", json=test_user)
        assert response.status_code == 200, response.text
        data = response.json()
        assert test_user["email"] == data["email"]
        assert "id" in data
        response = client.post("/users/", json=test_user)
        assert response.status_code == 400, response.text
    
    
    # TODO: pv2 add version with Pydantic v2
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Wed Mar 13 19:07:10 GMT 2024
    - 16.1K bytes
    - Viewed (0)
  9. tests/test_tutorial/test_body_multiple_params/test_tutorial001_an.py

    def test_post_no_body_q_bar(client: TestClient):
        response = client.put("/items/5?q=bar", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5, "q": "bar"}
    
    
    def test_post_no_body(client: TestClient):
        response = client.put("/items/5", json=None)
        assert response.status_code == 200
        assert response.json() == {"item_id": 5}
    
    
    def test_post_id_foo(client: TestClient):
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 7.5K bytes
    - Viewed (0)
  10. tests/test_tutorial/test_request_files/test_tutorial002.py

                        "type": "value_error.missing",
                    }
                ]
            }
        )
    
    
    def test_post_body_json():
        response = client.post("/files/", json={"file": "Foo"})
        assert response.status_code == 422, response.text
        assert response.json() == IsDict(
            {
                "detail": [
                    {
                        "type": "missing",
                        "loc": ["body", "files"],
    Python
    - Registered: Sun Apr 28 07:19:10 GMT 2024
    - Last Modified: Thu Apr 18 19:40:57 GMT 2024
    - 8.5K bytes
    - Viewed (0)
Back to top