开发者

How to send JSON requests to a remote server?

开发者 https://www.devze.com 2022-12-17 06:34 出处:网络
I\'d like to send a JSON rpc to a remote web-server. The client-side of my application must be completely javascript. The choice of the client library should be independant from the json-开发者_运维问

I'd like to send a JSON rpc to a remote web-server. The client-side of my application must be completely javascript. The choice of the client library should be independant from the json-开发者_运维问答rpc implementation on the server-side. I don't need json-over-http. Simple json objects over tcp/ip is enough for my use-case. Thanks


You could try jsolait. AFAIR it has support for JsonRPC 1.0 over sockets.


Since you are connecting to a remote web server, you will have to use HTTP.

You can use XMLHttpRequest for this from Javascript or you can use a library such as jquery that packages it up in an easier to use API. Many Javascript libraries support this functionality.


I would use Ajax with jQuery. Dead simple.

JQuery Post Documention

0

精彩评论

暂无评论...
验证码 换一张
取 消