{"id":4473,"date":"2017-03-19T20:02:52","date_gmt":"2017-03-19T12:02:52","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=4473"},"modified":"2017-04-18T22:13:01","modified_gmt":"2017-04-18T14:13:01","slug":"bug%e5%ae%98%e6%96%b9httpclient%e7%9a%84%e4%b8%80%e5%a4%84bug%e5%8f%8a%e8%a7%a3%e5%86%b3%e5%8a%9e%e6%b3%95","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=4473","title":{"rendered":"[Bug]\u5b98\u65b9HttpClient\u7684\u4e00\u5904Bug\u53ca\u89e3\u51b3\u529e\u6cd5"},"content":{"rendered":"<p>Delphi\/C++ Builder \u65b0\u589e\u52a0\u7684 TNetHttpClient\/THttpClient \u5728\u901a\u8baf\u65f6\uff0c\u5bf9 304 \u7684\u9519\u8bef\u5904\u7406\u4e0d\u6b63\u786e\uff0c304 \u5728 HTTP \u534f\u8bae\u7684\u6807\u51c6\u662f\u672a\u53d8\u66f4\uff0c\u4f46\u5728 System.Net.HttpClient.Android\/Windows\/Mac \u91cc\uff0c\u90fd\u9519\u8bef\u7684\u5f53\u6210\u4e86\u91cd\u5b9a\u5411\u5904\u7406\u3002\u5728\u5b98\u65b9\u7684\u4fee\u8ba2\u51fa\u6765\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5728\u00a0TWinHTTPClient\/TAndroidHTTPClient \u7684\u00a0DoProcessStatus \u91cc\uff0cTMacConnectionDataDelegate \u7684\u00a0connectionWillSendRequestRedirectResponse \u91cc\uff0c\u627e\u5230\u7c7b\u4f3c\u4e0b\u9762\u7684\u4e00\u884c\u4ee3\u7801\uff1a<\/p>\n<pre class=\"lang:delphi decode:true\">if xxx.HandleRedirects and (LStatus &gt;= 300) and (LStatus &lt; 400)  then<\/pre>\n<p>\u4fee\u6539\u5b83\uff0c\u5c06 304 \u6392\u9664\u6389\u5373\u53ef\uff1a<\/p>\n<pre class=\"lang:delphi decode:true  \">if xxxClient.HandleRedirects and (LStatus &gt;= 300) and (LStatus &lt; 400)  and (LStatus&lt;&gt;304) then<\/pre>\n<p>\u4fee\u6539\u540e\u7cfb\u7edf\u6e90\u7801\u653e\u5230\u81ea\u5df1\u9879\u76ee\u7684\u76ee\u5f55\u4e0b\uff0c\u7136\u540e\u7f16\u8bd1\u81ea\u5df1\u7684\u9879\u76ee\u5c31\u53ef\u4ee5\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Delphi\/C++ Builder \u65b0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[145,69,8,602,21],"tags":[714,713,715],"class_list":["post-4473","post","type-post","status-publish","format-standard","hentry","category-android","category-c-builder","category-delphi","category-ios","category-misc","tag-714","tag-httpclient","tag-715"],"views":5177,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4473"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4473\/revisions"}],"predecessor-version":[{"id":4555,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/4473\/revisions\/4555"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}