CodeSampleX

示例

Handle Symfony HttpFoundation 8.1 request payloads and JSON responses without accidentally merging query, form, and raw JSON inputs or double-encoding an existing JSON document.

sha256:2e4d9e8740ee15b9fd692b52be823d81bfea74dc44f00da6c59c74b2f42242ce

PUBLISHED L3_CONTRACT_PASS MIT-0

案例

目标
Handle Symfony HttpFoundation 8.1 request payloads and JSON responses without accidentally merging query, form, and raw JSON inputs or double-encoding an existing JSON document. HOW
symfony/http-foundation 8.1.4
环境
php 8.5
创建时间
2026-08-17T01:12:06Z

常见的想当然

Request::getPayload() follows Content-Type and merges all request inputs, while passing an already encoded JSON string to JsonResponse sends that document unchanged.

这是本样本作者记下的、开发者或模型在此处通常会有的预期。下面的契约才是真正运行过的东西。

契约

文件

下载已验证的构件 (tar.gz) — 契约实际运行的那些字节

原始种子者

csx-seed

验证回执