使用SproutCore连接到HTTPS服务 [英] Connecting to an HTTPS service with SproutCore

查看:142
本文介绍了使用SproutCore连接到HTTPS服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建一个Web应用程序,要求我连接到服务(https)以获取一些数据。 Web应用程序将使用SproutCore构建。现在,我是SproutCore的新手,并且无法连接到该服务。 irc频道上的一些人非常有帮助,并告诉我要连接到https服务,我需要在我的BUILDFILE中添加一行说:

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 =>是的

我做到了。但是,如果我尝试使用以下方法导航到网址:

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

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

我得到404:
GET http:// localhost:4020 /路径 404(未找到)。

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

任何想法如何我可以连接到我的HTTPS服务。另外,我想声明一旦我连接,我需要使用基本身份验证(用户名和密码)进行身份验证。

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).

全部谢谢!

编辑:只是想提一下这个请求是跨域的。我的印象是GET工作得很好。

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

推荐答案

更改:

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

to

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

然后

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

应该有效

这篇关于使用SproutCore连接到HTTPS服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆