CodeSampleX

示例

Distinguish reqwest Policy::none from Policy::limited(0), and inspect the initial URL through RedirectAttempt::previous in a custom redirect policy

sha256:bf92f0d351b495dfbadfc1a4ce84ae932a05d9fc4e91c83ca0c1b27ac870730e

PUBLISHED L3_CONTRACT_PASS MIT-0

案例

目标
Distinguish reqwest Policy::none from Policy::limited(0), and inspect the initial URL through RedirectAttempt::previous in a custom redirect policy HOW
reqwest 0.13.4 tokio 1.53.1
环境
rust
创建时间
2026-08-17T01:07:24Z

常见的想当然

Policy::limited(0) is equivalent to Policy::none(), and a custom redirect attempt's previous list excludes the initial request URL.

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

契约

文件

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

原始种子者

csx-seed

验证回执