<bdo id='uBZfo'></bdo><ul id='uBZfo'></ul>

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

      <legend id='uBZfo'><style id='uBZfo'><dir id='uBZfo'><q id='uBZfo'></q></dir></style></legend>

      <tfoot id='uBZfo'></tfoot>

      JS fetch,没有得到响应的标题

      JS fetch, not getting headers on response(JS fetch,没有得到响应的标题)
    3. <small id='4B2cA'></small><noframes id='4B2cA'>

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

                <tfoot id='4B2cA'></tfoot>
                  <tbody id='4B2cA'></tbody>
                <legend id='4B2cA'><style id='4B2cA'><dir id='4B2cA'><q id='4B2cA'></q></dir></style></legend>

                本文介绍了JS fetch,没有得到响应的标题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我正在使用 fetch 向 wordpress api 发出请求,但我在响应中得到一个空的 headers 对象,有人知道为什么吗?

                I'm making a request using fetch to wordpress api, but I get a empty headers object on the response, anyone knows why?

                这是我的获取操作

                export const getJobs = () => {
                  return dispatch => {
                    fetch(endpoints.jobs)
                      .then(res => res.json())
                      .then(data => dispatch(setJobs(data)))
                  }
                };
                

                这是我在做 res.json 之前得到的对象

                and here's the object that I get before doing res.json

                body: (...)
                bodyUsed: false
                headers: {}
                ok: true
                redirected: false
                status: 200
                statusText: "OK"
                type: "cors"
                url: "url"
                

                关于如何从响应中获取所有标头的任何想法?

                any ideas on how I can get all the headers from the response?

                推荐答案

                使用 CORS 时访问响应头有限制.由于您的响应类型是 cors,这可能是罪魁祸首.

                There is a restriction on accessing response headers when using CORS. Since your response type is cors that might be the culprit.

                请参阅此 详细回答.

                这篇关于JS fetch,没有得到响应的标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                相关文档推荐

                业务场景:使用update语句去更新数据库字段。 原因:update接收值不正确。原来代码: $query = "UPDATE student SET date = now() WHERE id = $id";$result = $mysqli-query($query2) or die($mysqli-error); // 问题出现了在这句 $data = $result-fetch_ass
                在开发JS过程中,会经常遇到两个小数相运算的情况,但是运算结果却与预期不同,调试一下发现计算结果竟然有那么长一串尾巴。如下图所示: 产生原因: JavaScript对小数运算会先转成二进制,运算完毕再转回十进制,过程中会有丢失,不过不是所有的小数间运算会
                问题描述: 在javascript中引用js代码,然后导致反斜杠丢失,发现字符串中的所有\信息丢失。比如在js中引用input type=text onkeyup=value=value.replace(/[^\d]/g,) ,结果导致正则表达式中的\丢失。 问题原因: 该字符串含有\,javascript对字符串进行了转
                Rails/Javascript: How to inject rails variables into (very) simple javascript(Rails/Javascript:如何将 rails 变量注入(非常)简单的 javascript)
                CoffeeScript always returns in anonymous function(CoffeeScript 总是以匿名函数返回)
                Ordinals in words javascript(javascript中的序数)

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

                    <tbody id='AdYVy'></tbody>

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

                          <tfoot id='AdYVy'></tfoot>