[英]Cross-site json rpc : Python server side and Mozilla extension using Javascript client side
I am building a Mozilla extension that contacts a Python application on a remote server to send and receive data. 我正在构建一个Mozilla扩展程序,该扩展程序与远程服务器上的Python应用程序联系以发送和接收数据。 The Python application can be called using xml-rpc from a Python console.
可以从Python控制台使用xml-rpc调用Python应用程序。 I am attempting to design a JSON-RPC that would contact the same application.
我正在尝试设计将与同一应用程序联系的JSON-RPC。 Developing the Python server side, which can be accessed using python console, has been easy.
开发Python服务器端(可以使用python控制台进行访问)非常容易。 However, I am having difficulties making the Mozilla extension to connect to the Python server side.
但是,我很难使Mozilla扩展连接到Python服务器端。
How do I make cross site JSON rpc calls? 如何进行跨站点JSON rpc调用? I have googled and read about many libraries, but none of them seem to work.
我已经在Google上搜索并阅读了许多图书馆的书,但是它们似乎都不起作用。 I am not sure if it is because of some origin policy or because my server side is not able to process the data.
我不确定这是由于某些原始策略还是因为我的服务器端无法处理数据。 Any help would be appreciated.
任何帮助,将不胜感激。
You can use http://mimic-xmlrpc.sourceforge.net/ js library, or just XMLHttpRequest. 您可以使用http://mimic-xmlrpc.sourceforge.net/ js库,也可以仅使用XMLHttpRequest。 I'm just with the same problem, and i'm an absolute newby with js :(
我只是有同样的问题,我绝对是js的新手:(
mimic seems grat, even if i'm having problems parsing the data returned.. 模仿似乎很高兴,即使我在解析返回的数据时遇到问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.