{"id":419,"date":"2023-05-19T22:01:12","date_gmt":"2023-05-19T14:01:12","guid":{"rendered":"https:\/\/www.xfan.top\/?p=419"},"modified":"2023-06-05T01:53:50","modified_gmt":"2023-06-04T17:53:50","slug":"httpxmissingbrotli","status":"publish","type":"post","link":"https:\/\/www.xfan.top\/index.php\/2023\/05\/19\/419\/","title":{"rendered":"httpx\u7f3a\u5c11brotli \u5bfc\u81f4POST\u54cd\u5e94\u4e71\u7801"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">POST\u8bf7\u6c42\u5934\u4e2d <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Accept-Encoding : gzip, deflate, br<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u54cd\u5e94 <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Content-Encoding : br<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u5982\u679cpython\u5f53\u524d\u8fd0\u884c\u73af\u5883\u6ca1\u6709\u5b89\u88c5 brotli \u6216 brotlicffi \u5e93\uff0c\u5c06\u5bfc\u81f4\u4e0d\u80fd\u6b63\u786e\u89e3\u538b\u54cd\u5e94\u6570\u636e\uff0c\u5bfc\u81f4\u4e71\u7801\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5b89\u88c5\u4efb\u610f\u4e00\u4e2a\u4e4b\u540e\u7acb\u523b\u89e3\u51b3\uff0c\u89c1\u4e0b\u56fe<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/www.xfan.top\/wp-content\/uploads\/2023\/05\/QQ\u56fe\u724720230519215749-626x1024.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"626\" height=\"1024\" data-original=\"https:\/\/www.xfan.top\/wp-content\/uploads\/2023\/05\/QQ\u56fe\u724720230519215749-626x1024.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-430\"  sizes=\"auto, (max-width: 626px) 100vw, 626px\" \/><\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">httpx\u6e90\u7801\u4e2d<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>try:\n    import brotlicffi as brotli\nexcept ImportError:  # pragma: no cover\n    try:\n        import brotli\n    except ImportError:\n        brotli = None<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"dependencies\">httpx\u6587\u6863\u7684\u8bf4\u660e<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The HTTPX project relies on these excellent libraries:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>httpcore<\/code>&nbsp;- The underlying transport implementation for&nbsp;<code>httpx<\/code>.<\/li>\n\n\n\n<li><code>h11<\/code>&nbsp;- HTTP\/1.1 support.<\/li>\n\n\n\n<li><code>certifi<\/code>&nbsp;- SSL certificates.<\/li>\n\n\n\n<li><code>idna<\/code>&nbsp;- Internationalized domain name support.<\/li>\n\n\n\n<li><code>sniffio<\/code>&nbsp;- Async library autodetection.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">As well as these <strong>optional <\/strong>installs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>h2<\/code>&nbsp;- HTTP\/2 support.&nbsp;<em>(Optional, with&nbsp;<code>httpx[http2]<\/code>)<\/em><\/li>\n\n\n\n<li><code>socksio<\/code>&nbsp;- SOCKS proxy support.&nbsp;<em>(Optional, with&nbsp;<code>httpx[socks]<\/code>)<\/em><\/li>\n\n\n\n<li><code>rich<\/code>&nbsp;- Rich terminal support.&nbsp;<em>(Optional, with&nbsp;<code>httpx[cli]<\/code>)<\/em><\/li>\n\n\n\n<li><code>click<\/code>&nbsp;- Command line client support.&nbsp;<em>(Optional, with&nbsp;<code>httpx[cli]<\/code>)<\/em><\/li>\n\n\n\n<li><strong><code>brotli<\/code>&nbsp;or&nbsp;<code>brotlicffi<\/code>&nbsp;- Decoding for \"brotli\" compressed responses.&nbsp;<em>(Optional, with&nbsp;<code>httpx[brotli]<\/code>)<\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>brotli \u6216 brotlicffi<\/strong> \u662f\u4e00\u4e2a\u53ef\u9009\u9879\uff0c\u5e76\u4e0d\u662f\u4f9d\u8d56\uff0c\u9ed8\u8ba4\u4e0d\u4f1a\u5b89\u88c5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>POST\u8bf7\u6c42\u5934\u4e2d \u54cd\u5e94 \u5982\u679cpython\u5f53\u524d\u8fd0\u884c\u73af\u5883\u6ca1\u6709\u5b89\u88c5 brotli \u6216 brotlicffi \u5e93\uff0c\u5c06\u5bfc [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-419","post","type-post","status-publish","format-standard","hentry","category-python"],"_links":{"self":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/comments?post=419"}],"version-history":[{"count":16,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/419\/revisions"}],"predecessor-version":[{"id":439,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/posts\/419\/revisions\/439"}],"wp:attachment":[{"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/media?parent=419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/categories?post=419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xfan.top\/index.php\/wp-json\/wp\/v2\/tags?post=419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}