Table of Contents

Property EnableCookies

Namespace
CurlUnity.Http

EnableCookies

是否接入所属 IHttpClient 的共享 cookie jar。默认 false。

true 时:服务端 Set-Cookie 写入 jar、后续请求自动回发匹配 cookie, 在 同一个 IHttpClient 实例 内跨请求持久化。 不同 client 实例的 jar 互相独立。

false 时:cookie engine 完全不启用 —— 本次请求既不读 jar 也不写 jar (即便 client 的 jar 已有条目也不会带出),且同一请求 redirect 链内的 Set-Cookie 也不会被解析回发。需要这两种行为之一时请置 true

jar 为纯内存存储,client Dispose 后清空;暂不支持文件持久化。

bool EnableCookies { get; set; }

Property Value

bool