简体   繁体   English

- 请求的资源上没有“Access-Control-Allow-Origin”标头。 因此不允许Origin'http:// localhost:8100'访问

[英]— No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access

while trying to access http:Localhost:9000/api/post from provider i get this error 尝试从提供程序访问http:Localhost:9000/api/post此错误

Failed to load http://127.0.0.1:8000/api/post: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access. is therefore not allowed access

any knows what is wrong. 任何人都知道什么是错的。

Your front and back end are on different ports which means your ajax requests are subject to cross origin security. 您的前端和后端位于不同的端口上,这意味着您的ajax请求受到跨源安全性的约束。

You need to do changes at your back-end api (server side) by adding 您需要通过添加在后端api(服务器端)进行更改

Access-Control-Allow-Origin: "*"; Access-Control-Allow-Origin:“*”;

in response headers according to the language you are using php,java or python etc 根据你使用php,java或python等语言的响应头

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 请求的资源上不存在“Access-Control-Allow-Origin”标头。 因此不允许Origin'http:// localhost:8100'访问 - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8100' is therefore not allowed access 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问来源“ http:// localhost” - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问来源“ http:// localhost:4400” - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4400' is therefore not allowed access Socket.io没有'Access-Control-Allow-Origin'标头出现在请求的资源上。 因此不允许Origin'http:// localhost'访问 - Socket.io No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问来源“ http:// localhost:4200” - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:4200' is therefore not allowed accesss AngularJS:所请求的资源上不存在“ Access-Control-Allow-Origin”标头。 因此,不允许访问原始“空” - AngularJS : No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access Golang 请求的资源上不存在“Access-Control-Allow-Origin”标头。 因此不允许访问原点 'null' - Golang No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问源“ file://”。 - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'file://' is therefore not allowed access. 所请求的资源上没有“ Access-Control-Allow-Origin”标头。 因此,不允许访问原始“空” - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access 请求的资源上不存在“Access-Control-Allow-Origin”标头。 Origin '...' 因此不允许访问 - No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '…' is therefore not allowed access
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM