Connecting to an HTTPS service with SproutCore

谁都会走 提交于 2019-12-12 02:17:18

问题


I'm building a web app that requires me to connect to a service (https) to get some data. The web app is to be built using SproutCore. Now, I'm super new to SproutCore, and haven't been able to get to connect to the service. Some folks on the irc channel were super helpful and told me that to connect to an https service, I need to add a line in my BUILDFILE that says:

proxy '/path', :to => "https://myWebService.com", :secure => true

I did that. However, if I try to navigate to the url using:

SC.Request.getUrl('/path').notify(this, 'notifyMe').send();

I get a 404: GET http://localhost:4020/path 404 (Not Found).

Any idea as to how I can connect to my HTTPS service. Additionally, I would like to state that once I connect, I would need to authenticate with it using basic auth (username and password).

Thanks all!

EDIT: Just wanted to mention that this request is Cross-Domain. I was under the impression that GET worked just fine cross domain.


回答1:


Change:

proxy '/path', :to => "https://myWebService.com", :secure => true

to

proxy '/', :to => "myWebService.com", :secure => true

then

SC.Request.getUrl('/path').notify(this, 'notifyMe').send();

should work



来源:https://stackoverflow.com/questions/8155461/connecting-to-an-https-service-with-sproutcore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!