久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <small id='swvHi'></small><noframes id='swvHi'>

      <tfoot id='swvHi'></tfoot>

      <legend id='swvHi'><style id='swvHi'><dir id='swvHi'><q id='swvHi'></q></dir></style></legend>
      <i id='swvHi'><tr id='swvHi'><dt id='swvHi'><q id='swvHi'><span id='swvHi'><b id='swvHi'><form id='swvHi'><ins id='swvHi'></ins><ul id='swvHi'></ul><sub id='swvHi'></sub></form><legend id='swvHi'></legend><bdo id='swvHi'><pre id='swvHi'><center id='swvHi'></center></pre></bdo></b><th id='swvHi'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='swvHi'><tfoot id='swvHi'></tfoot><dl id='swvHi'><fieldset id='swvHi'></fieldset></dl></div>
      • <bdo id='swvHi'></bdo><ul id='swvHi'></ul>

      1. XMLHttpRequest 的 getResponseHeader() 的限制?

        Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

      2. <legend id='1b25I'><style id='1b25I'><dir id='1b25I'><q id='1b25I'></q></dir></style></legend>

        <small id='1b25I'></small><noframes id='1b25I'>

          <bdo id='1b25I'></bdo><ul id='1b25I'></ul>

          <i id='1b25I'><tr id='1b25I'><dt id='1b25I'><q id='1b25I'><span id='1b25I'><b id='1b25I'><form id='1b25I'><ins id='1b25I'></ins><ul id='1b25I'></ul><sub id='1b25I'></sub></form><legend id='1b25I'></legend><bdo id='1b25I'><pre id='1b25I'><center id='1b25I'></center></pre></bdo></b><th id='1b25I'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='1b25I'><tfoot id='1b25I'></tfoot><dl id='1b25I'><fieldset id='1b25I'></fieldset></dl></div>
            <tbody id='1b25I'></tbody>
            <tfoot id='1b25I'></tfoot>
                  本文介紹了XMLHttpRequest 的 getResponseHeader() 的限制?的處理方法,對大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我注意到 XMLHttpRequest.getResponseHeader() 的結(jié)果并不總是與返回的真實(shí)標(biāo)頭匹配(如果請求是以常規(guī)方式發(fā)出的).

                  I've noticed that the results of and XMLHttpRequest.getResponseHeader() don't always match the real headers returned (if the request is made in a regular manner).

                  例如,假設(shè)我正在為 https://foo.example.com/api/resource/100 發(fā)出 xhr 請求.在 Chrome 的開發(fā)者控制臺中,在網(wǎng)絡(luò)"下,我可以看到正在做出的響應(yīng)——我還可以看到所有響應(yīng)標(biāo)頭(比如 10).但是(復(fù)制粘貼控制臺):

                  For example, assume I'm making an xhr request for https://foo.example.com/api/resource/100. In Chrome's developer console, under 'Network', I can see the response being made -- I can also see all of the response headers (say, 10). However (copy-pasted console):

                  > response
                    XMLHttpRequest
                  > response.getAllResponseHeaders();
                    "content-type: text/html
                    " 
                  

                  對可用的標(biāo)頭有任何限制嗎?這取決于響應(yīng)類型嗎?我記得有一套完整的 404 標(biāo)頭,但只有這個(gè) 400 的標(biāo)頭.

                  Are there any restrictions on what headers are available? Is this dependent on the response type? I remember getting a complete set of headers for 404s but just this one for 400s.

                  什么給了?

                  推薦答案

                  XMLHttpRequest 的標(biāo)準(zhǔn)化現(xiàn)狀A(yù)PI 僅限制對 Set-CookieSet-Cookie2 標(biāo)頭字段的訪問:

                  The current state of standardizing the XMLHttpRequest API does only restrict the access to the Set-Cookie and Set-Cookie2 header fields:

                  客戶端.getAllResponseHeaders()

                  client.getAllResponseHeaders()

                  返回響應(yīng)中的所有標(biāo)頭,字段名稱為 Set-CookieSet-Cookie2 的標(biāo)頭除外.

                  Returns all headers from the response, with the exception of those whose field name is Set-Cookie or Set-Cookie2.

                  應(yīng)返回任何其他標(biāo)頭字段.

                  Any other header field should be returned.

                  但是當(dāng)你做一個(gè)跨域請求時(shí),瀏覽器需要實(shí)現(xiàn) XMLHttpRequest Level 2 因?yàn)樵瓉淼?XMLHttpRequest 只允許同源請求:

                  But as you’re doing a cross-origin request, the browser needs to implement XMLHttpRequest Level 2 as the original XMLHttpRequest does only allow same-origin requests:

                  XMLHttpRequest Level 2 規(guī)范增強(qiáng)了 XMLHttpRequest 對象的新特性,例如跨域請求 […]

                  The XMLHttpRequest Level 2 specification enhances the XMLHttpRequest object with new features, such as cross-origin requests […]

                  在那里你可以讀到跨源資源共享規(guī)范過濾了那些過濾由 getResponseHeader() 公開的標(biāo)頭,用于非 same-origin 請求.".并且該規(guī)范禁止訪問除 簡單響應(yīng)頭字段(即Cache-ControlContent-LanguageContent-TypeExpiresLast-ModifiedPragma):

                  There you can read that the "Cross-Origin Resource Sharing specification filters the headers that filters the headers that are exposed by getResponseHeader() for non same-origin requests.". And that specification forbids access to any response header field other except the simple response header fields (i.e. Cache-Control, Content-Language, Content-Type, Expires, Last-Modified, and Pragma):

                  用戶代理必須過濾掉除簡單響應(yīng)頭之外的所有響應(yīng)頭 […]

                  User agents must filter out all response headers other than those that are a simple response header […]

                  例如因此,XMLHttpRequest 的 getResponseHeader() 方法不會(huì)暴露上面未指明的任何標(biāo)頭.

                  E.g. the getResponseHeader() method of XMLHttpRequest will therefore not expose any header not indicated above.

                  這篇關(guān)于XMLHttpRequest 的 getResponseHeader() 的限制?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會(huì)等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)

                  <tfoot id='BCEgI'></tfoot>

                          <tbody id='BCEgI'></tbody>

                        <small id='BCEgI'></small><noframes id='BCEgI'>

                        1. <i id='BCEgI'><tr id='BCEgI'><dt id='BCEgI'><q id='BCEgI'><span id='BCEgI'><b id='BCEgI'><form id='BCEgI'><ins id='BCEgI'></ins><ul id='BCEgI'></ul><sub id='BCEgI'></sub></form><legend id='BCEgI'></legend><bdo id='BCEgI'><pre id='BCEgI'><center id='BCEgI'></center></pre></bdo></b><th id='BCEgI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='BCEgI'><tfoot id='BCEgI'></tfoot><dl id='BCEgI'><fieldset id='BCEgI'></fieldset></dl></div>

                        2. <legend id='BCEgI'><style id='BCEgI'><dir id='BCEgI'><q id='BCEgI'></q></dir></style></legend>
                          • <bdo id='BCEgI'></bdo><ul id='BCEgI'></ul>

                            主站蜘蛛池模板: 色婷综合网 | 亚洲国产精品久久久 | 日本一二区视频 | 欧美成人第一页 | 日韩高清黄色 | 性高湖久久久久久久久3小时 | 欧美 日韩精品 | 精品亚洲一区二区三区 | 中文字幕av一区 | 精品一区精品二区 | 一区二区三区在线观看免费视频 | 自拍偷拍在线视频 | 日本黄色影片在线观看 | 日韩视频在线观看中文字幕 | 丝袜 亚洲 欧美 日韩 综合 | 亚洲不卡一 | 国产午夜精品福利 | 欧美亚洲日本 | 日韩成人在线观看 | 色婷婷av99xx | 99精品国产一区二区三区 | 欧美日韩高清 | 国产一区精品在线 | www日韩| 一区二区三区成人 | 亚洲一区在线播放 | 男人亚洲天堂 | 精品一二三 | 免费在线观看av片 | h视频在线免费 | 91豆花视频 | 中文字幕一区二区三区不卡 | 免费在线观看黄色av | 精品国模一区二区三区欧美 | 久久精品一区二区 | 国产成人jvid在线播放 | 免费看欧美一级片 | 欧美精品99| 日本在线视频一区二区 | 日韩中文字幕在线观看 | 高清视频一区二区三区 |