我有 Angular 产品服务和使用 HttpClient 方法调用 "http://jsonplaceholder.typicode.com/posts" URL。
但是,它显示 "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5700' is therefore not allowed access. The response had HTTP status code 403."。
根据我的理解,以上错误需要设置头文件,但这只是公共获取 API,所以我认为不需要为此设置头文件。
提前致谢。
但是,它显示 "No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5700' is therefore not allowed access. The response had HTTP status code 403."。
根据我的理解,以上错误需要设置头文件,但这只是公共获取 API,所以我认为不需要为此设置头文件。
提前致谢。