【发布时间】:2021-06-03 10:45:27
【问题描述】:
例如我需要调用rest api:
let developerId ="123#212";
let url = `${Constants.BASE_URL}${marketId}/developers/${developerId}`;
return this.http.get(url);
但后端只获得123 而不是123#212
到目前为止我尝试的是做但没有工作
-
使用 encodeURIComponent
encodeURIComponent(${developerId}) -
使用
HttpInterceptor与https://stackoverflow.com/a/54524089相同
使用 Postman 调用其余 api 完美工作,但不能在 Angular 中
【问题讨论】:
-
为什么邮递员可以调用这种rest api而angular却不能做到?
标签: javascript angular typescript httpclient