سؤال

It seems like you should be able to use telnet to manually make json-rpc calls. However, when I try this, I get no response at all from the server and have to shut down the telnet client. Do I need to send headers and/or somehow indicate that my input is complete?

هل كانت مفيدة؟

المحلول

You have a small problem: you've completely misunderstood everything!

https://en.bitcoin.it/wiki/API_reference_%28JSON-RPC%29

It says right there that it supports JSON-RPC over HTTP. Nothing at all about JSON-RPC over plain TCP (what you're calling "Telnet" protocol).

You say "It seems like you should be able to use telnet to manually make json-rpc calls" but you don't mention how you came to this conclusion.

JSON-RPC is typically implemeted over HTTP, but can be implemented over plain TCP, websockets, or any bi-directional internet protocol. That being said, the overwhelming majority of JSON-RPC server implementations expose their APIs via JSON-RPC over HTTP.

As others have mentioned, you can talk HTTP from a telnet client and the payload of that conversation can be JSON-RPC.... if you know how. Just because you can doesn't meant you should.

نصائح أخرى

I have a project that will let you host a Json-Rpc server over telnet if you like. It doesn't come with telnet support built in, but it would be trivial to host it over telnet. See the console hosting example and just replace the console with a telnet server.

http://jsonrpc2.codeplex.com/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top