pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <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="gemg2go" 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="qig2owg" 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="ye2ca0s" 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>

                            主站蜘蛛池模板: 网站建设,北京网站建设,北京网站建设公司,网站系统开发,北京网站制作公司,响应式网站,做网站公司,海淀做网站,朝阳做网站,昌平做网站,建站公司 | 深圳美安可自动化设备有限公司,喷码机,定制喷码机,二维码喷码机,深圳喷码机,纸箱喷码机,东莞喷码机 UV喷码机,日期喷码机,鸡蛋喷码机,管芯喷码机,管内壁喷码机,喷码机厂家 | 防锈油-助焊剂-光学玻璃清洗剂-贝塔防锈油生产厂家 | 全温恒温摇床-水浴气浴恒温摇床-光照恒温培养摇床-常州金坛精达仪器制造有限公司 | 反渗透水处理设备|工业零排放|水厂设备|软化水设备|海南净水设备--海南水处理设备厂家 | 学校用栓剂模,玻璃瓶轧盖钳,小型安瓿熔封机,实验室安瓿熔封机-长沙中亚制药设备有限公司 | 水热合成反应釜-防爆高压消解罐-西安常仪仪器设备有限公司 | 砂尘试验箱_淋雨试验房_冰水冲击试验箱_IPX9K淋雨试验箱_广州岳信试验设备有限公司 | 重庆私家花园设计-别墅花园-庭院-景观设计-重庆彩木园林建设有限公司 | 液晶拼接屏厂家_拼接屏品牌_拼接屏价格_监控大屏—北京维康 | 防潮防水通风密闭门源头实力厂家 - 北京酷思帝克门窗 | 清洁设备_洗地机/扫地机厂家_全自动洗地机_橙犀清洁设备官网 | 国产离子色谱仪,红外分光测油仪,自动烟尘烟气测试仪-青岛埃仑通用科技有限公司 | 液压升降平台_剪叉式液压/导轨式升降机_传菜机定做「宁波日腾升降机厂家」 | 自动售货机_无人售货机_专业的自动售货机运营商_免费投放售货机-广州富宏主官网 | 多物理场仿真软件_电磁仿真软件_EDA多物理场仿真软件 - 裕兴木兰 | 三防漆–水性三防漆–水性浸渍漆–贝塔三防漆厂家 | 沧州友城管业有限公司-内外涂塑钢管-大口径螺旋钢管-涂塑螺旋管-保温钢管生产厂家 | 电动打包机_气动打包机_钢带捆扎机_废纸打包机_手动捆扎机 | 心肺复苏模拟人|医学模型|急救护理模型|医学教学模型上海康人医学仪器设备有限公司 | 开锐教育-学历提升-职称评定-职业资格培训-积分入户 | 中细软知识产权_专业知识产权解决方案提供商 | 旋转滴界面张力仪(张力测定仪器)-百科| 搅拌磨|搅拌球磨机|循环磨|循环球磨机-无锡市少宏粉体科技有限公司 | 合肥防火门窗/隔断_合肥防火卷帘门厂家_安徽耐火窗_良万消防设备有限公司 | 安徽华耐泵阀有限公司-官方网站 安德建奇火花机-阿奇夏米尔慢走丝|高维|发那科-北京杰森柏汇 | 净化车间_洁净厂房_净化公司_净化厂房_无尘室工程_洁净工程装修|改造|施工-深圳净化公司 | 钢格板_钢格栅_格栅板_钢格栅板 - 安平县鑫拓钢格栅板厂家 | 琉璃瓦-琉璃瓦厂家-安徽盛阳新型建材科技有限公司 | 天津仓库出租网-天津电商仓库-天津云仓一件代发-【博程云仓】 | 酒糟烘干机-豆渣烘干机-薯渣烘干机-糟渣烘干设备厂家-焦作市真节能环保设备科技有限公司 | 依维柯自动挡房车,自行式国产改装房车,小型房车价格,中国十大房车品牌_南京拓锐斯特房车 - 南京拓锐斯特房车 | 心得体会网_心得体会格式范文模板 | 挨踢网-大家的导航! | 南方珠江-南方一线电缆-南方珠江科技电缆-南方珠江科技有限公司 南汇8424西瓜_南汇玉菇甜瓜-南汇水蜜桃价格 | 轴承振动测量仪电箱-轴承测振动仪器-测试仪厂家-杭州居易电气 | 华夏医界网_民营医疗产业信息平台_民营医院营销管理培训 | 高铝砖-高铝耐火球-高铝耐火砖生产厂家-价格【荣盛耐材】 | 板框压滤机-隔膜压滤机-厢式压滤机生产厂家-禹州市君工机械设备有限公司 | 生产加气砖设备厂家很多,杜甫机械加气砖设备价格公道 | 杭州厂房降温,车间降温设备,车间通风降温,厂房降温方案,杭州嘉友实业爽风品牌 |