[英]append a value to existing url in reactjs
I have the following url and a parameter :我有以下网址和一个参数:
number:200
"http://localhost:8000/textpath"
I want the path to be like this:我希望路径是这样的:
"http://localhost:8000/textpath/200"
How do I do that using Reactjs?I want to use the appended url in fetch method as follows:我如何使用 Reactjs 做到这一点?我想在 fetch 方法中使用附加的 url,如下所示:
fetch("http://localhost:8000/textpath/200")
一个简单的附加就完成了工作。不必复杂化
fetch("http://localhost:8000/textpath/"+number)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.