html - React GET 请求在末尾添加字符
问题描述
我正在尝试创建一个代理服务器,它将使用 Amazon EC2 上部署的服务来渲染照片。每当我连接到服务器并加载页面时,这是我得到的错误消息:
获取http://127.0.0.1:55055/restaurant/65/%3C 404(未找到)
获取http://127.0.0.1:55055/restaurant/65/!404(未找到)
获取http://127.0.0.1:55055/restaurant/65/D 404(未找到)
获取http://127.0.0.1:55055/restaurant/65/O 404(未找到)
获取http://127.0.0.1:55055/restaurant/65/C 404(未找到)
在我的代码中,获取请求是http://ec2-34-201-243-233.compute-1.amazonaws.com/restaurant/${restaurantId}
为什么随机字符(%3C、!、D 等)添加到 url 的末尾,如何防止这种情况发生?
这是我的 HTML:
<body>
<div id="Photos"></div>
<script src="https://s3-us-west-1.amazonaws.com/my-bucket-name/bundle.js"></script>
<script>
ReactDOM.render(
React.createElement(Photos),
document.getElementById('Photos')
);
</script>
</body>
解决方案
推荐阅读
- odoo - 如何在 odoo v11 中授予访问权限?
- laravel - 使用或不使用密钥运行 Laravel 应用程序
- php - 三元运算符PHP的未定义索引错误
- sql - 错误 [37000] [IBM][CLI Driver] CLI0118E SQL 语法无效。SQLSTATE=37000
- sql-server - SSRS 根据参数值更改列标题
- c++ - 如何在 C++ 运行时生成布尔条件?
- python - 为什么这个矩阵初始化会给我意想不到的结果?
- vue.js - vuejs 在@click 事件中使用 if 语句
- ruby - 通过 gitlab CI/CD 在 CloudFront 上推送 Jekyll 站点时如何解决“s3_website”问题?
- python - 如何迭代 if 条件中的列表?