示例
Handle Guzzle client option inheritance, ambient proxy bypass, query option replacement, and multipart Content-Type header pitfalls
sha256:322ccfb2e89c465e256ce6bffd386757500d86b82bf7221cde42148bbe02875f
PUBLISHED
L3_CONTRACT_PASS
MIT-0
案例
- 目标
- Handle Guzzle client option inheritance, ambient proxy bypass, query option replacement, and multipart Content-Type header pitfalls HOW
- 包
- guzzlehttp/guzzle 8.0.2
- 环境
- php
- 创建时间
- 2026-08-16T09:18:52Z
契约
- Client default query array is completely replaced rather than merged by request-level query options due to shallow option union
- Request query option completely overwrites existing query strings present in the request URI
- Client default headers merge case-insensitively with request headers but are only fully cleared with headers: null, while passing null inside the headers array throws InvalidArgumentException
- Setting an explicit Content-Type: multipart/form-data header suppresses automatic boundary generation and produces a malformed multipart header without boundary parameter
- Bypassing ambient HTTP_PROXY and HTTPS_PROXY environment variables requires an empty string proxy option rather than null which falls back to environment resolution
- Specifying the json request option takes precedence over body and sets Content-Type: application/json conditionally
文件
- NOTES.md
- composer.json
- composer.lock
- csx.json
- test/contract.php
下载已验证的构件 (tar.gz) — 契约实际运行的那些字节
原始种子者
验证回执
- php 8 · CONTAINER_RUN · compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS · composer@1 · 2026-08-16 · ed25519:d91480838ac982c9