久久久久久久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() 的限制?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我注意到 XMLHttpRequest.getResponseHeader() 的結果并不總是與返回的真實標頭匹配(如果請求是以常規方式發出的).

                  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).

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

                  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
                    " 
                  

                  對可用的標頭有任何限制嗎?這取決于響應類型嗎?我記得有一套完整的 404 標頭,但只有這個 400 的標頭.

                  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 的標準化現狀API 僅限制對 Set-CookieSet-Cookie2 標頭字段的訪問:

                  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()

                  返回響應中的所有標頭,字段名稱為 Set-CookieSet-Cookie2 的標頭除外.

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

                  應返回任何其他標頭字段.

                  Any other header field should be returned.

                  但是當你做一個跨域請求時,瀏覽器需要實現 XMLHttpRequest Level 2 因為原來的 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 規范增強了 XMLHttpRequest 對象的新特性,例如跨域請求 […]

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

                  在那里你可以讀到跨源資源共享規范過濾了那些過濾由 getResponseHeader() 公開的標頭,用于非 same-origin 請求.".并且該規范禁止訪問除 簡單響應頭字段(即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):

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

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

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

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

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

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

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  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標頭) - IT屋-程序員軟件開發技術分
                  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 部分內容)

                  <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>

                            主站蜘蛛池模板: 亚洲精品一区在线观看 | 欧美日韩亚洲一区 | 亚洲一区精品在线 | 免费久 | 免费观看成人鲁鲁鲁鲁鲁视频 | 成人小视频在线观看 | 亚洲欧美日韩精品久久亚洲区 | 午夜精品久久久久久久久久久久 | 国产一区二区三区四区三区四 | 成人在线视频一区 | 久久精品青青大伊人av | 亚洲一二三视频 | 日日骚网 | 国产av毛片| av国产精品 | 久久久精品久久久 | 欧美视频第二页 | 成人精品鲁一区一区二区 | 国产中文字幕亚洲 | 欧美日韩免费视频 | 国产成人区 | 国产99视频精品免费播放照片 | 国产精品久久久久久久久久久久冷 | a级毛片免费高清视频 | 亚洲成色777777在线观看影院 | 精品无码久久久久久国产 | 91综合网| 国产福利在线小视频 | 国产精品一区二区三区久久久 | 亚洲一区二区三区四区五区午夜 | 亚洲香蕉 | 日韩一区二区三区在线观看视频 | 成人免费淫片aa视频免费 | 精品日韩一区二区 | 国产精品一区在线观看你懂的 | 最新中文字幕一区 | 亚洲欧洲中文 | 日韩一区二区精品 | 亚洲福利视频网 | av在线一区二区三区 | 国产一区二区三区四区五区加勒比 |