1
在服务器端我使用Rails。目的是,我没有配置CORS。因此,正如我所料,在浏览器中,我不能做的请求到Rails的服务器,因为我得到这个错误:由于什么原因,我可以通过curl访问资源,但不能在浏览器中访问?
但我可以为终端做,使用curl:
[email protected] ~ $ curl http://localhost:3000/people
[{"id":3,"name":"macabeus","age":20,"created_at":"2016-07-31T22:45:05.490Z","updated_at":"2016-07-31T22:45:05.490Z"},{"id":4,"name":"foo","age":10,"created_at":"2016-07-31T22:45:24.415Z","updated_at":"2016-07-31T22:45:24.415Z"}]
由于什么原因卷曲可以,但浏览器不能?我知道如何解决这个问题。我只是想了解我之前问过的。