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

<tfoot id='fEypq'></tfoot>

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

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

        HTTP 預檢 (OPTIONS) 請求僅在 IE 中失敗

        HTTP preflight (OPTIONS) request fails in IE only(HTTP 預檢 (OPTIONS) 請求僅在 IE 中失敗)
      1. <small id='5wGrp'></small><noframes id='5wGrp'>

            <tbody id='5wGrp'></tbody>

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

                <tfoot id='5wGrp'></tfoot>

                  本文介紹了HTTP 預檢 (OPTIONS) 請求僅在 IE 中失敗的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我嘗試向我的 REST API 發(fā)出 POST 請求.這是代碼片段(使用 AngularJS):

                   $http({方法:'POST',網(wǎng)址:網(wǎng)址,數(shù)據(jù):reqBody,標題:{內容類型":應用程序/json"}}).then(函數(shù)(響應){...}).catch(函數(shù) (錯誤) {...});

                  根據(jù)

                  問題是,HTTP 選項響應包含瀏覽器處理實際 HTTP 請求所需的一切.

                  解決方案

                  我找到了所有這些混亂的原因.

                  API 服務和網(wǎng)站位于同一個域中,但在不同的端口上.具體來說,API 服務位于:

                  <塊引用>

                  myDomain.com/apiService

                  網(wǎng)站位于:

                  <塊引用>

                  myDomain.com:44443/webSite

                  因此,當網(wǎng)絡瀏覽器從以下位置初始化調用時:

                  myDomain.com:44443/webSite/page1

                  到:

                  myDomain.com/apiService/service1

                  由于 CORS,Internet Explorer 阻止了調用.出于某種原因,Chrome 在這方面沒有那么嚴格,因為它成功地調用了 API.

                  為了使其在 Internet Explorer 中運行,我將網(wǎng)站移至與 API 相同的端口:

                  <塊引用>

                  myDomain.com/apiService

                  myDomain.com/webSite

                  I trying to make a POST request to my REST API. Here is the code snippet (using AngularJS):

                          $http({
                              method: 'POST',
                              url: url,
                              data: reqBody,
                              headers: {
                                  'content-type': 'application/json'
                              }
                          })
                          .then(function (response) {...})
                          .catch(function (error) {...});
                  

                  According to this article, because of the HTTP header

                  'content-type': 'application/json'

                  browser concludes that it will have to make an "not-simple" HTTP request which requires handshake with a server (HTTP options request will be sent before actual HTTP request).

                  Chrome handles the request like a charm, but IE (11 in my case) fails with the following messages:

                  The thing is, HTTP options response contains everything the browser needs to proceed with the actual HTTP request.

                  解決方案

                  I found the reason for all that mess.

                  The API service and the website were located on the same domain, but on different ports. To be specific, the API service was located on:

                  myDomain.com/apiService

                  and the website was located on:

                  myDomain.com:44443/webSite

                  Thus, when the web browser was initializing the call from:

                  myDomain.com:44443/webSite/page1

                  to:

                  myDomain.com/apiService/service1

                  Internet Explorer was blocking the call because of the CORS. For some reason, Chrome was less strict in that matter, because it succeeded to make the call to the API.

                  To make it work in Internet Explorer, I moved the website to the same port as the API:

                  myDomain.com/apiService

                  myDomain.com/webSite

                  這篇關于HTTP 預檢 (OPTIONS) 請求僅在 IE 中失敗的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關文檔推薦

                  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屋-程序員軟件開發(fā)技術分
                  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 部分內容)

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

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

                            <tfoot id='gKqzX'></tfoot>

                            <legend id='gKqzX'><style id='gKqzX'><dir id='gKqzX'><q id='gKqzX'></q></dir></style></legend>
                              <tbody id='gKqzX'></tbody>
                          • 主站蜘蛛池模板: 天天天操天天天干 | 欧美成人免费在线 | 欧美一区二区三区在线播放 | 日韩精品在线观看一区二区 | 久久免费视频观看 | 福利视频1000| 久久艹免费视频 | 欧美一区二区三区在线观看视频 | wwww.xxxx免费| 精品在线看 | 亚洲精品一二三区 | 国产精品一区二区在线播放 | 成人国产在线视频 | 一区二区免费在线 | 精品免费视频 | 欧美日韩精品一区 | 青青久久av北条麻妃海外网 | 欧美日韩国产在线 | 国产亚洲精品一区二区三区 | 亚洲精品综合 | 国产精品a久久久久 | 国产日韩精品在线 | 欧美性视频在线播放 | 五月天激情电影 | 黄色国产在线视频 | 日韩免费网站 | 中文字幕91 | 精品日韩 | 日日摸夜夜添夜夜添精品视频 | 色成人免费网站 | 亚洲国产精品人人爽夜夜爽 | 亚洲aⅴ精品 | 欧美在线a | 黄视频免费在线 | 成人国产精品久久 | 你懂的在线视频播放 | 日韩精品影院 | 欧美日韩亚洲一区 | 视频一二三区 | 91免费在线看 | 亚洲精品一区二区三区 |