Dear. I have a fully synchronized bitcoin node on my device. I have an app that I made in his language. C#. All I want is to connect to the Bitcoin Core server through the app I made. So I want the summons. the appropriate. In order to put it in my application and control my Bitcoin Core wallet through this application. And that's it. Thank you all for your wonderful responses
So you want to control your Bitcoin core wallet with your app built with C# language. We already told you what you need RPC API should be work if you can't able to use them and you receive a few errors using RPC commands I suggest you check your Bitcoin.conf file and add these 2
#For JSON-RPC commands
server=1
# Accept public REST requests
rest=1
Also, I think you still don't know how to put an HTTP request in your app you can use it to send commands like " $ ./bitcoin-cli getbalance" from your wallet.
Most of us here don't understand why you can't make it work and honestly, if you receive an error sending these RPC commands you should tell us the error so that we know the next suggestion. Without error or any update from your APP, this thread will become a long thread without solving your case.
Yes, brother, this is what I mean by submitting an application in my program. I searched and found his desk on the wiki. I found a suitable arrangement for the language. C#. Check if this is correct.....
HttpWebRequest webRequest =
(HttpWebRequest) WebRequest.Create ("
http://localhost.:8332");
webRequest.Credentials = new NetworkCredential("user", "pwd");
/// IMPORTANT, otherwise the service will not be able to fulfill your request properly
webRequest.ContentType="application/json-rpc";
webRequest.Method = "POST";
JObject joe = new JObject(),
joe.Add(new JProperty("jsonrpc", "1.0")));
joe.Add(new JProperty("id", "1")));
joe.Add(new JProperty("method", method));
// Parameters are array values required by the method..
If (Params.Keys.Count == 0)
{
joe.Add(new JProperty("params", new JArray()));
}
else
{
props JArray = new JArray();
// Add props in reverse order!
for (int i = Params.Keys.Count - 1; i > = 0; i--)
{
.... // add parameters
}
joe.Add (new JProperty ("params", props);
}
// json sequence for request
string s = JsonConvert.SerializeObject(Joe),
byte[] byteArray = Encoding.UTF8.GetBytes,
webRequest.ContentLength = byteArray.Length,
dataStream = webRequest.GetRequestStream(),
dataStream.Write(byteArray, 0, byteArray.Length);
dataStream.Close(),
WebResponse webResponse = webRequest.GetResponse(),
... // deserialize the response