{"id":1816,"date":"2024-02-21T17:14:16","date_gmt":"2024-02-21T08:14:16","guid":{"rendered":"https:\/\/www.rocher.kyoto.jp\/arbr\/?p=1816"},"modified":"2024-03-02T12:17:32","modified_gmt":"2024-03-02T03:17:32","slug":"esp%e3%81%aewificlientsecure%e3%81%a7%e3%82%b5%e3%83%bc%e3%83%90%e3%81%8b%e3%82%89%e6%83%85%e5%a0%b1%e3%82%92%e3%82%82%e3%82%89%e3%81%86%e6%99%82%e3%82%b5%e3%83%bc%e3%83%90%e3%81%a7contentslength","status":"publish","type":"post","link":"https:\/\/www.rocher.kyoto.jp\/arbr\/?p=1816","title":{"rendered":"ESP\u306eWiFiClientSecure\u3067\u30b5\u30fc\u30d0\u304b\u3089\u60c5\u5831\u3092\u3082\u3089\u3046\u6642\u30b5\u30fc\u30d0\u3067ContentsLength\u6307\u5b9a\u3057\u3066\u3044\u306a\u3044\u3068\u9762\u5012"},"content":{"rendered":"\n<p>ESP8266(ESP-WROOM-02)\u306e\u5185\u5bb9\u3002ESP-WROOM-32\u3067\u306f\u306a\u3044\u306e\u3067\u304c\u304a\u304a\u3088\u305d\u540c\u3058\u3068\u601d\u3046\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u73fe\u8c61<\/h2>\n\n\n\n<p>ESP8266\u306eWiFiClientSecure\u3067\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3088\u3046\u3068\u3057\u305f\u3002\u672c\u6765\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u672c\u4f53(<em>\u30da\u30a4\u30ed\u30fc\u30c9\u672c\u6587<\/em>)\u306f&#8221;<strong>[0]<\/strong>&#8220;\u3092\u671f\u5f85\u3057\u3066\u3044\u305f\u304c\u4ee5\u4e0b\u306e\u4e0b\uff13\u884c\u306e\u3088\u3046\u306b\u30ec\u30b9\u30dd\u30f3\u30b9\u304c\u671f\u5f85\u3057\u3066\u3044\u305f\u3082\u306e\u3068\u9055\u3046\u5f62\u306b\u306a\u3063\u3066\u3044\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Connecting to https:\/\/hoge.co.jp\/api\/fuga\nConnected to server\nServer: nginx\nDate: Wed, 21 Feb 2024 05:21:47 GMT\nContent-Type: text\/html\nTransfer-Encoding: chunked\nConnection: close\n\n<strong>3\n[0]\n0<\/strong><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7406\u7531<\/h2>\n\n\n\n<p>\u3053\u308c\u306f<a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/HTTP\/Headers\/Transfer-Encoding\">Transfer-Encoding: chunked<\/a>\u306b\u306a\u3063\u3066\u3044\u3066<em>\u30da\u30a4\u30ed\u30fc\u30c9\u672c\u6587<\/em>\u304c <\/p>\n\n\n\n<p>\u30c7\u30fc\u30bf1\u306e\u30d0\u30a4\u30c8\u6570\\r\\n\u30c7\u30fc\u30bf1\\r\\n0\\r\\n<\/p>\n\n\n\n<p>\u3068\u3044\u3046\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306b\u306a\u3063\u3066\u3044\u308b\u305f\u3081\u3002\u9577\u3044\u3082\u306e\u9001\u308b\u5834\u5408\u306f<\/p>\n\n\n\n<p>\u30c7\u30fc\u30bf1\u306e\u30d0\u30a4\u30c8\u6570\\r\\n\u30c7\u30fc\u30bf1\\r\\n\u30c7\u30fc\u30bf2\u306e\u30d0\u30a4\u30c8\u6570\\r\\n\u30c7\u30fc\u30bf2\\r\\n\u2026\u30c7\u30fc\u30bfx\u306e\u30d0\u30a4\u30c8\u6570\\r\\n\u30c7\u30fc\u30bfx\\r\\n\u20260\\r\\n<\/p>\n\n\n\n<p>\u3068\u306a\u308b\u3002\u306a\u304a\u30c7\u30fc\u30bf\u306e\u30d0\u30a4\u30c8\u6570\u306f16 \u9032\u6570\u8868\u8a18\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u5bfe\u51e6<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u305d\u306e\uff11<\/h3>\n\n\n\n<p>\u5bfe\u51e6\u3068\u3057\u3066\u305d\u3046\u3044\u3046\u3082\u306e\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3093\u3067\u3082\u3088\u3044\u3051\u3069\u3001\u30de\u30eb\u30c1\u30d0\u30a4\u30c8\u306e\u5834\u5408\u30c7\u30fc\u30bf1,2\u306e\u9593\u3067\u3076\u3063\u305f\u5207\u3089\u308c\u308b\u306e\u3067\u3064\u306a\u3052\u308b\u306e\u3068\u304b\u9762\u5012\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u305d\u306e\uff12<\/h3>\n\n\n\n<p>\u53ef\u80fd\u306a\u3089\u30b5\u30fc\u30d0\u5074\u3067\u9001\u308b\u969b\u306b<a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/HTTP\/Headers\/Transfer-Encoding\">Transfer-Encoding: chunked<\/a>\u3058\u3083\u306a\u304f\u3057\u305f\u3044\u3002<\/p>\n\n\n\n<p>\u4eca\u56de\u306f\u30b5\u30fc\u30d0\u5074\u306fpython\u306eBaseHTTPRequestHandler\u3092\u4f7f\u3063\u3066\u3044\u308b\u304c\u30ec\u30b9\u30dd\u30f3\u30b9\u306bContent-Length\u3092\u3064\u3051\u3066\u3084\u308c\u3070\u81ea\u52d5\u3067<a href=\"https:\/\/developer.mozilla.org\/ja\/docs\/Web\/HTTP\/Headers\/Transfer-Encoding\">Transfer-Encoding: chunked<\/a>\u3058\u3083\u306a\u304f\u306a\u3063\u305f\u3002\u300c\u3068\u308a\u3042\u3048\u305a\u3001Content-Length\u3064\u3044\u3066\u306a\u3044\u304b\u3089chunked\u3067\u304a\u304f\u3068\u3063\u304f\u308f\u300d\u3068\u3044\u3046\u4ed5\u69d8\u3060\u3063\u305f\u3063\u307d\u3044\u3002\uff08\u660e\u793a\u7684\u306b\u30d8\u30c3\u30c0\u30fc\u4ed8\u3051\u305f\u5834\u5408\u306b\u6d88\u3048\u308b\u304b\u306f\u672a\u78ba\u8a8d\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code has-white-color has-dark-gray-background-color has-text-color has-background has-link-color wp-elements-64aca1079c7f0ea6d5a2969c6a102d05\"><code>from http.server import BaseHTTPRequestHandler, HTTPServer\nfrom reserve_count import reserve_count\nimport urllib.parse\n\nclass MyHandler(BaseHTTPRequestHandler):\n    def do_GET(self):\n        parsed_path = urllib.parse.urlparse(self.path)\n        query_params = urllib.parse.parse_qs(parsed_path.query)\n\n\n        if parsed_path.path == '\/api\/reserve_count':\n            <strong>response_content = \"\u307b\u3052\".encode('utf-8')<\/strong>\n            self.send_response(200)\n            self.send_header('Content-type', 'text\/html')\n            <strong>self.send_header('Content-Length', len(response_content))<\/strong>\n            self.end_headers()<\/code><\/pre>\n\n\n\n<p>http1.1\u306e\u4ed5\u69d8\u7684\u306b\u306fTransfer-Encoding: chunked\u306e\u6642\u306b\u306fContent-Length\u4e0d\u8981\u3089\u3057\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>ESP8266(ESP-WROOM-02)\u306e\u5185\u5bb9\u3002ESP-WROOM-32\u3067\u306f\u306a\u3044\u306e\u3067\u304c\u304a\u304a\u3088\u305d\u540c\u3058\u3068\u601d\u3046\u3002 \u73fe\u8c61 ESP8266\u306eWiFiClientSecure\u3067\u30b5\u30fc\u30d0\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3088\u3046\u3068\u3057\u305f\u3002\u672c\u6765\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u672c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117],"tags":[123,132],"class_list":["post-1816","post","type-post","status-publish","format-standard","hentry","category-117","tag-esp","tag-esp-wroom-02"],"_links":{"self":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1816","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1816"}],"version-history":[{"count":2,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1816\/revisions"}],"predecessor-version":[{"id":1911,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=\/wp\/v2\/posts\/1816\/revisions\/1911"}],"wp:attachment":[{"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1816"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1816"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rocher.kyoto.jp\/arbr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1816"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}