首页 > 其他分享 >How to fix Fetch API GET request return an opaque response bug All In One

How to fix Fetch API GET request return an opaque response bug All In One

时间:2023-10-22 13:24:36浏览次数:37  
标签:return GET 9a99 bug 1feb 1c1e9e5fce3f API https response

How to fix Fetch API GET request return an opaque response bug All In One

Status Code: 302 Found


fetch(`https://www.hulu.com/watch/78974b54-1feb-43ce-9a99-1c1e9e5fce3f`, {mode: "no-cors"})
.then(function (response) {
  console.log(`response`, response);
  // The API call was successful!
  return response.text();
})
.then(function (html) {
  // This is the HTML from our response as a text string
  console.log(html);
})
.catch(function (err) {
  // There was an error
  console.warn('Something went wrong.', err);
});

image

solutions

URL 重定向

https://www.hulu.com/watch/78974b54-1feb-43ce-9a99-1c1e9e5fce3f

https://www.hulu.com/movie/my-favorite-girlfriend-78974b54-1feb-43ce-9a99-1c1e9e5fce3f?entity_id=78974b54-1feb-43ce-9a99-1c1e9e5fce3f

Response Headers

Location: /movie/my-favorite-girlfriend-78974b54-1feb-43ce-9a99-1c1e9e5fce3f?entity_id=78974b54-1feb-43ce-9a99-1c1e9e5fce3f


fetch(`https://www.hulu.com/watch/78974b54-1feb-43ce-9a99-1c1e9e5fce3f`, {mode: "no-cors"})
.then(function (response) {
  console.log(`response`, response.headers);
  // The API call was successful!
  return response.text();
})
.then(function (html) {
  // This is the HTML from our response as a text string
  console.log(html);
})
.catch(function (err) {
  // There was an error
  console.warn('Something went wrong.', err);
});

demos

(

标签:return,GET,9a99,bug,1feb,1c1e9e5fce3f,API,https,response
From: https://www.cnblogs.com/xgqfrms/p/17780326.html

相关文章

  • error link2038检测到_ITERATOR_DEBUG_LEVEL的不匹配项: 值“0”不匹配值“2”
    nmake.opt参考:https://blog.csdn.net/qq526495605/article/details/51852294......
  • BUG:cURL error 60: SSL certificate problem: unable to get local issuer certificat
    PHPssl证书问题(我的环境是phpstudy)解决方案:1.https://curl.se/docs/caextract.html 打开网址,下载最新PEM 2.将证书放进对应PHP版本extras/ssl文件里面3.修改对应版本的PHP.INI 4.重启PHP问题解决 ......
  • [swin-trans]分布式训练的debug:ValueError: Error initializing torch.distributed us
    在用torch.distributed.init_process_group(backend='nccl',init_method='env://',world_size=world_size,rank=rank)时,出现1、ValueError:Errorinitializingtorch.distributedusingenv://rendezvous:environmentvariableMASTER_ADDRexpected,b......
  • 记录--谁还没个靠bug才能正常运行的程序
    这里给大家分享我在网上总结出来的一些知识,希望对大家有所帮助最近遇到一个问题,计算滚动距离,滚动比例达到某界定值时,显示mask,很常见吧^ _ ^这里讲的不是这个需求的实现,是其中遇到了一个比较有意思的bug,靠这个bug才达到了正确效果,以及这个bug是如何暴露的(很重要)。下面是演示......
  • xxl-job执行java任务报错: unable to find valid certification path to requested tar
    1、错误:xxl-job调用https接口显示证书验证失败[错误信息:sun.security.validator.ValidatorException:PKIXpathbuildingfailed:sun.security.provider.certpath.SunCertPathBuilderException:unabletofindvalidcertificationpathtorequestedtarget]2023-10-2015......
  • flutter vscode iOS app debug 出错 记录1
    出现类似错误Error(Xcode):Targetdebug_unpack_iosfailed:Exception:Failedtocodesign/Users/cappuccino/Desktop/develop/code/app1/flutter_application_1/build/ios/Debug-iphonesimulator/Flutter.framework/Flutterwithidentity-.这个是由于代码所在文件夹被iC......
  • 小明哥学linux驱动之USB-OTG(基于gadget框架)【转】
    转自:https://blog.csdn.net/silence3039/article/details/100187666一、简介OTG是On-The-Go的缩写。其设计的初衷是为了两个“外设”在没有PC(Host)的情况下,也可以通过USB进行数据传输。可以理解为,拥有OTG功能的USB设备(OTG设备)既可以做host,也可以做peripheral。二、OTG基本结构2......
  • error: Microsoft Visual C++ 14.0 is required. Get it with "Build Tools for Visua
    error:MicrosoftVisualC++14.0isrequired.Getitwith"BuildToolsforVisualStudio":https://visualstudio.microsoft.com/downloads/ 一、背景说明在编译安装达梦数据库的Python驱动dmPython时,执行编译安装命令如下:pythonsetup.pyinstall 报错信息......
  • C# UWP 项目debug发布无问题运行,Release模式闪退问题的解决
    近期解决了一个非常迷惑的一个问题,问题就在于,项目在本地环境运行时没有任何异常和闪退的现象,而且以Debug模式发布后,发布包安装后,运行也没有任何问题,但是当以Release模式发布并安装,就会出现闪退的问题。针对对系统日志的分析和错误的解决,我们一共找到两个原因导致这个问题的出现。......
  • IDEA使用debug
    IDEA使用debug1.为什么需要Debug?编好的程序在执行过程中如果出现错误,该如何查找或定位错误呢?简单的代码直接就可以看出来,但如果代码比较复杂,就需要借助程序调试工具(Debug)来查找错误了。2.Debug的步骤1、添加断点2、启动调试3、单步执行4、观察变量和执行流程,找到并解......