• <legend id='vMYMu'><style id='vMYMu'><dir id='vMYMu'><q id='vMYMu'></q></dir></style></legend>

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

        • <bdo id='vMYMu'></bdo><ul id='vMYMu'></ul>
      1. <i id='vMYMu'><tr id='vMYMu'><dt id='vMYMu'><q id='vMYMu'><span id='vMYMu'><b id='vMYMu'><form id='vMYMu'><ins id='vMYMu'></ins><ul id='vMYMu'></ul><sub id='vMYMu'></sub></form><legend id='vMYMu'></legend><bdo id='vMYMu'><pre id='vMYMu'><center id='vMYMu'></center></pre></bdo></b><th id='vMYMu'></th></span></q></dt></tr></i><div id='vMYMu'><tfoot id='vMYMu'></tfoot><dl id='vMYMu'><fieldset id='vMYMu'></fieldset></dl></div>
      2. <tfoot id='vMYMu'></tfoot>

        Node js/Angular js - 注意:显示临时标题

        时间:2023-05-15

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

      3. <tfoot id='r8lBc'></tfoot>

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

              <legend id='r8lBc'><style id='r8lBc'><dir id='r8lBc'><q id='r8lBc'></q></dir></style></legend>
              • <bdo id='r8lBc'></bdo><ul id='r8lBc'></ul>
                  <tbody id='r8lBc'></tbody>
                  本文介绍了Node js/Angular js - 注意:显示临时标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  限时送ChatGPT账号..

                  这是我的 Angular js 代码:

                  $http({
                                  method:'POST',
                                  withCredential:true,
                                  url:$scope.config.app_ws+'auth/signup',
                                  data:{user:$scope.auth}
                              }).success(function(status, response){
                  
                                  console.log(response);
                              }).error(function(status, response){
                                  alert(response+'Bummer :( , an error occured plese retry later. ');
                              });
                  

                  这是我的 Node.js 块后端:

                   var allow_cross_domain= function(req, res, next) {
                        res.header('X-Powered-By', 'hey.heyssssssss.org');
                  
                        var oneof = false;
                        if(req.headers.origin) {
                          res.header('Access-Control-Allow-Origin', req.headers.origin);
                          oneof = true;
                        }
                        if(req.headers['access-control-request-method']) {
                          res.header('Access-Control-Allow-Methods', req.headers['access-control-request-method']);
                          oneof = true;
                        }
                        if(req.headers['access-control-request-headers']) {
                          res.header('Access-Control-Allow-Headers', req.headers['access-control-request-headers']);
                          oneof = true;
                        }
                        if(oneof) {
                          res.header('Access-Control-Max-Age', 60 * 60 * 24 * 365);
                        }
                      // intercept OPTIONS method
                      if (oneof && req.method == 'OPTIONS') {
                        res.send(200);
                      } else {
                        next();
                      }
                      }
                  
                      app.use(allow_cross_domain);
                  
                      app.post('/auth/signup', function (req, res) { res.send('wtff'); });
                  

                  我只是从 Angular 调用 POST localhost:3000/auth/signup 到 Node,但我得到 **CAUTION : 临时标头已显示.** 在 chrome 控制台中.

                  I'm just calling POST localhost:3000/auth/signup from Angular to Node, but i get **CAUTION : Provisional headers are shown.** in chrome console.

                  铬(小心):

                  Firefox(大约 30/60 秒没有响应,然后出现 alert() :/):

                  Firefox (NO RESPONSE for about 30/60 seconds and then the alert() comes up :/ ):

                  这可能是什么?

                  如果我使用 GET 一切正常,只是使用 POST 我会遇到麻烦,这怎么可能?

                  IF i use GET everything is ok, is just with POST that i get troubles how is that possible?

                  推荐答案

                  我个人在 angular 中使用了这个reset"方法:

                  personaly I use this "reset" method in angular:

                  app.config(['$httpProvider', function ($httpProvider) {
                    //Reset headers to avoid OPTIONS request (aka preflight)
                    $httpProvider.defaults.headers.common = {};
                    $httpProvider.defaults.headers.post = {};
                    $httpProvider.defaults.headers.put = {};
                    $httpProvider.defaults.headers.patch = {};
                  }]);
                  

                  这篇关于Node js/Angular js - 注意:显示临时标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:FormData() 对象不会从表单添加提交类型的输入,而在 Firefox 上 下一篇:Firefox 异常'JavaScript 组件没有名为:“可用"的方法'

                  相关文章

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

                    <tfoot id='Byt4Y'></tfoot>

                      <bdo id='Byt4Y'></bdo><ul id='Byt4Y'></ul>
                  1. <i id='Byt4Y'><tr id='Byt4Y'><dt id='Byt4Y'><q id='Byt4Y'><span id='Byt4Y'><b id='Byt4Y'><form id='Byt4Y'><ins id='Byt4Y'></ins><ul id='Byt4Y'></ul><sub id='Byt4Y'></sub></form><legend id='Byt4Y'></legend><bdo id='Byt4Y'><pre id='Byt4Y'><center id='Byt4Y'></center></pre></bdo></b><th id='Byt4Y'></th></span></q></dt></tr></i><div id='Byt4Y'><tfoot id='Byt4Y'></tfoot><dl id='Byt4Y'><fieldset id='Byt4Y'></fieldset></dl></div>
                    <legend id='Byt4Y'><style id='Byt4Y'><dir id='Byt4Y'><q id='Byt4Y'></q></dir></style></legend>