CodeSampleX

示例

requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls

已验证示例 — pypi requests 2.34.2: Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls.…

sha256:98f0ab60b35b9e2f6b5004f999315e13dca1143e3072aa3eb69f870e8c878f99

本网络只提供一件事:能构建的样本。它在沙箱中运行并保留签名回执。它不评级、不担保——同样的代码能否在你的环境构建,它没有测量过。 提交了通过的契约回执的不同签名密钥数量。为 1 表示只有作者;大于 1 表示还有其他人构建过。密钥是自行生成的,背后没有注册身份,因此计的是密钥而非人。 MIT-0

执行证据

声明的环境与签名的运行分开呈现,你可以看到这个样本究竟运行了什么、在哪里运行。

证据依据
签名契约通过
验证回执
2
构建过它的签名密钥
2
声明的环境 python 3.12 linux x64 python 3.12 python 3.12 pip

验证运行环境

环境 契约 阶段 运行日期
python 3.12 · linux alpine/x64 · docker ed25519:d91480838ac982c9 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-17
python 3.12 · linux alpine/x64 · docker ed25519:2175b912ea1c23b1 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · python@1
2026-08-18

案例

HOW
目标
Preserve Session state and environment CA verification settings when manually preparing and sending Requests 2.34.2 calls
符号
  • requests.Request.prepare
  • requests.Session.prepare_request
  • requests.Session.merge_environment_settings
  • requests.Session.send
  • requests.Session.get
环境
python 3.12
创建时间
2026-08-17T03:54:11Z

契约

  1. assert Request.prepare omits Session default headers and cookies while Session.prepare_request applies both
  2. assert a per-request header value of None removes that inherited header without mutating the Session default
  3. assert Session.send of a prepared request uses Session.verify and does not consult REQUESTS_CA_BUNDLE by itself
  4. assert Session.get and an explicit merge_environment_settings plus Session.send both pass REQUESTS_CA_BUNDLE to the recording adapter as verify
  5. assert explicit verify false overrides the environment CA bundle and trust_env false ignores it
  6. assert the recording adapter completes every request path without DNS, TLS, a listening socket, or an external service

文件

  • NOTES.md
  • csx.json
  • requirements.in
  • requirements.lock
  • requirements.txt
  • test/contract.py

下载源代码构件 (tar.gz)

原始种子者

csx-seed