<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body><section><h1>仕様書</h1><refs xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:"><ul xmlns="http://www.w3.org/1999/xhtml"><li><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="8" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[8]</anchor-end> <cite xml:lang="en">XMLHttpRequest Standard</cite> (<time>2018-04-17 18:43:05 +09:00</time>) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send">https://xhr.spec.whatwg.org/#dom-xmlhttprequest-send</anchor-external></li></ul></refs></section><section><h1>歴史</h1><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="1" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[1]</anchor-end> <cite>Hawk's W3 Laboratory : XML : XMLHttpRequestについて</cite> (<time>2009-01-04 12:58:40 +09:00</time> 版) <anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="http://web.archive.org/web/20060901145130/www.hawk.34sp.com/stdpls/xml/xmlhttprequest.html">http://web.archive.org/web/20060901145130/www.hawk.34sp.com/stdpls/xml/xmlhttprequest.html</anchor-external></p><blockquote><p>引数として指定可能なオブジェクトはブラウザ毎に異なりますが、多くのブラウザで少なくとも文字列とDOMDocumentが指定可能なようです。</p></blockquote><blockquote><p>以下は各ブラウザ共通の挙動です。<ul><li>文字列はUTF-8でエンコードされる。Content-Typeヘッダを書き換えて明示的にエンコーディング指定を行っても無効になる(IE/Geckoの場合。Operaではそもそも指定不可)。</li><li>適切な値のContent-Lengthヘッダが自動的に送信される。</li></ul></p><p>ブラウザ毎に異なるのはデフォルトの Content-Type の扱いです。</p><table><tbody><tr><td>IE(MSXML)</td><td>送信されない</td></tr><tr><td>Gecko</td><td>text/xml</td></tr><tr><td>Opera</td><td>text/xml; charset=utf-8</td></tr><tr><td>KHTML</td><td>text/plain</td></tr></tbody></table><p>IE(MSXML)の挙動はHTTPクライアントとしてどうなんだという気がしますが…もちろんsetRequestHeaderを使って明示的に指定することは出来ます。</p></blockquote><comment-p xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:10:"><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="2" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[2]</anchor-end> <code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">Content-Type</anchor></code> は省略可能だから問題はない (ただし<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">既定値</anchor>が
<code xmlns="http://www.w3.org/1999/xhtml" class="HTTP" xml:lang="en"><anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">text/plain</anchor>; <anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">charset</anchor>=<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">iso-8859-1</anchor></code> なのは問題)。</comment-p><blockquote><p>DOMDocumentを指定した場合、基本的にはDOMDocumentの”文字列表現”が送信されます。以下がその際に用いられる文字エンコーディングと、送信される文字列と同等の文字列を取得するための方法です。</p><table><tbody><tr><td>-</td><td>文字エンコーディング</td><td>文字列表現の出所</td></tr><tr><td>IE(MSXML)</td><td>XML宣言のencoding指定に従う デフォルトはUTF-8</td><td>DOMDocumentのxmlプロパティ(推測)</td></tr><tr><td>Gecko</td><td>UTF-8</td><td>XMLSerializer.serializeToString(DOMDocument)</td></tr><tr><td>Opera</td><td>UTF-8</td><td>DOMDocument.documentElement.outerHTML(推測)</td></tr><tr><td>KHTML</td><td>UTF-8</td><td>不明</td></tr></tbody></table><p>Operaが送信するのはルート要素以下らしく、XML宣言などは含まれません。またGecko/KHTML/OperaではHTML DOMDocument(つまり window.document)も指定できます。 </p></blockquote><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="3" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[3]</anchor-end> <cite>Refactor send() in terms of Fetch · 82e602e · whatwg/xhr</cite>
( (<time>2014-07-01 09:41:36 +09:00</time> 版))
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/commit/82e602e4507c19802c373bf19f5e956973f1c6c3">https://github.com/whatwg/xhr/commit/82e602e4507c19802c373bf19f5e956973f1c6c3</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="4" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[4]</anchor-end> <cite xml:lang="en">Allow developers to opt-out of sync XHR with feature policy · Issue #178 · whatwg/xhr</cite>
(<time>2018-03-03 12:50:54 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/issues/178">https://github.com/whatwg/xhr/issues/178</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="5" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[5]</anchor-end> <cite xml:lang="en">Integrate feature policy by clelland · Pull Request #177 · whatwg/xhr</cite>
(<time>2018-03-03 12:52:25 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/pull/177">https://github.com/whatwg/xhr/pull/177</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="6" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[6]</anchor-end> <cite xml:lang="en">Feature proposal: sync-xhr · Issue #126 · WICG/feature-policy</cite>
(<time>2018-03-03 12:55:51 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/WICG/feature-policy/issues/126">https://github.com/WICG/feature-policy/issues/126</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="7" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[7]</anchor-end> <cite xml:lang="en">Define Content-Type manipulation in terms of MIME Sniffing</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">annevk</anchor>著, <time>2018-04-16 18:51:34 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/commit/edc6f8f16f58d201afb49e40ca166b8bc1ae74a3">https://github.com/whatwg/xhr/commit/edc6f8f16f58d201afb49e40ca166b8bc1ae74a3</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="9" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[9]</anchor-end> <cite xml:lang="en">Fix send() charset overriding to use new MIME type infrastructure · Issue #188 · whatwg/xhr</cite>
(<time>2018-04-17 23:08:38 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/issues/188">https://github.com/whatwg/xhr/issues/188</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="10" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[10]</anchor-end> <cite xml:lang="en">Define Content-Type manipulation in terms of MIME Sniffing by annevk · Pull Request #176 · whatwg/xhr</cite>
(<time>2018-04-17 23:09:16 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/pull/176">https://github.com/whatwg/xhr/pull/176</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="11" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[11]</anchor-end> <cite xml:lang="en">Editorial: rewrite send()'s body/content-type processing</cite>
(<anchor xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:">domenic</anchor>著, <time>2018-04-24 00:09:11 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/commit/f47bbab42dabe1f52e5e9f1ed1fa6df06a6eb310">https://github.com/whatwg/xhr/commit/f47bbab42dabe1f52e5e9f1ed1fa6df06a6eb310</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="12" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[12]</anchor-end> <cite xml:lang="en">Editorial: less-confusing content-type manipulation algorithm for send() · Issue #197 · whatwg/xhr</cite>
(<time>2018-04-24 16:16:12 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/issues/197">https://github.com/whatwg/xhr/issues/197</anchor-external></p><p><anchor-end xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:anchor="13" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:">[13]</anchor-end> <cite xml:lang="en">Editorial: rewrite send()'s body/content-type processing by domenic · Pull Request #205 · whatwg/xhr</cite>
(<time>2018-04-24 16:16:30 +09:00</time>)
<anchor-external xmlns="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resScheme="URI" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:resParameter="https://github.com/whatwg/xhr/pull/205">https://github.com/whatwg/xhr/pull/205</anchor-external></p></section></body></html>