code/04-rag/rewrites.json
28 行 · 4.2 KB程式碼和執行結果保留原樣(簡體中文),與實際執行時完全一致。
{
"服务器要求 Digest 认证怎么办?": "httpx Digest authentication server requires digest auth how to use DigestAuth parameter class terms",
"怎么把超时完全关掉,让请求一直等下去?": "How to disable all timeouts in httpx and let requests wait indefinitely? timeout=None Timeout connect read write pool request",
"连接超时和读取超时能分别设置成不同的值吗?": "Can connect timeout and read timeout be set separately to different values in httpx? httpx.Timeout connect read timeout parameters",
"怎么开启 HTTP/2?": "How to enable HTTP/2 in httpx? http2=True Client AsyncClient HTTP/2 support protocol",
"怎么知道一个响应实际用的是 HTTP/1.1 还是 HTTP/2?": "How to check if an httpx Response used HTTP/1.1 or HTTP/2? Response.http_version HTTPVersion HTTP/2 protocol version",
"请求要带用户名和密码做基本认证,怎么写?": "httpx Basic Auth username password request authentication how to",
"怎么让请求走 HTTP 代理?": "How to use an HTTP proxy with httpx requests? proxy mounts proxies parameter Client",
"想用 SOCKS 代理,需要额外安装什么?": "How to use SOCKS proxy in httpx, what extra dependency to install, httpx[socks], socksio, proxy parameter, AsyncClient, Client, proxies",
"怎么关闭 SSL 证书校验?": "How to disable SSL certificate verification in httpx? `verify=False`, `Client(verify=False)`, `httpx.Client`, `SSLContext`, `cert`, `ssl`",
"怎么上传一个文件?": "How to upload a file with httpx? files parameter multipart/form-data AsyncClient Client",
"下载很大的文件时,怎么一块一块地读,而不是一次读进内存?": "httpx large file download streaming chunk read instead of loading into memory",
"响应是 404 或 500 时,怎么让它直接抛异常?": "httpx raise exception for status code 404 500 raise_for_status HTTPStatusError",
"异步发请求应该用哪个类?": "Which class should be used for asynchronous requests in httpx? AsyncClient async client",
"httpx 和 requests 在处理重定向上有什么不一样?": "httpx vs requests redirect handling differences follow_redirects allow_redirects history max_redirects RedirectLoop",
"怎么限制连接池里最多同时有多少个连接?": "How to limit the maximum number of concurrent connections in the connection pool httpx Limits max_connections ConnectionLimits transport",
"写测试时,怎么不真的发网络请求,而是返回一个假的响应?": "How to mock HTTP responses without real network requests in httpx tests MockTransport handler request response",
"怎么显示下载进度?": "How to show download progress in httpx? stream iter_bytes chunk_size response streaming progress bar tqdm",
"想在每个请求发出之前和收到响应之后都执行一段代码,比如打日志,怎么做?": "httpx event hooks request response logging how to run code before request and after response",
"有些域名不想走代理,环境变量怎么设置?": "httpx NO_PROXY environment variable exclude domains from proxy",
"网页返回的中文是乱码,怎么指定解码用的字符集?": "How to specify character set for decoding response text in httpx? response.encoding response.charset response.text response.content default_encoding charset_encoding",
"httpx 默认会自动跟随重定向吗?怎么开启?": "Does httpx follow redirects by default? how to enable follow_redirects? httpx Client follow_redirects parameter, AsyncClient, request, get, Redirect, TooManyRedirects",
"httpx 支持 HTTP/3 吗?": "Does httpx support HTTP/3? http3 HTTP/3 support transport AsyncHTTPTransport HTTPTransport",
"httpx 自带请求失败自动重试的功能吗?": "Does httpx support automatic retry on request failure? retries transport HTTPTransport AsyncHTTPTransport max_retries",
"httpx 默认会自动跟随重定向吗?": "Does httpx follow redirects by default? follow_redirects redirects Client params",
"怎么给 httpx 设置代理?": "How to set proxy in httpx? proxies proxy mounts transport HTTPTransport AsyncHTTPTransport",
"httpx 的超时分成哪几种?每种管什么?": "httpx timeout types: Timeout class connect read write pool timeout; what each timeout controls"
}