aboutsummaryrefslogtreecommitdiff
path: root/src/rpc
diff options
context:
space:
mode:
authorLuke Dashjr <luke-jr+git@utopios.org>2024-04-23 22:31:03 +0000
committerfanquake <fanquake@gmail.com>2024-05-31 16:44:47 +0100
commit3c08e11c3ea4499e8d20609e2417cac859b3e98e (patch)
tree58a5af4ca365c11be3da215578ab860419ec8a3e /src/rpc
parent457e1846d2bf6ef9d54b9ba1a330ba8bbff13091 (diff)
doc: JSON-RPC request Content-Type is application/json
Specify json content type in RPC examples
Diffstat (limited to 'src/rpc')
-rw-r--r--src/rpc/util.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rpc/util.cpp b/src/rpc/util.cpp
index ed32af7646..486c421518 100644
--- a/src/rpc/util.cpp
+++ b/src/rpc/util.cpp
@@ -176,7 +176,7 @@ std::string HelpExampleCliNamed(const std::string& methodname, const RPCArgList&
std::string HelpExampleRpc(const std::string& methodname, const std::string& args)
{
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"2.0\", \"id\": \"curltest\", "
- "\"method\": \"" + methodname + "\", \"params\": [" + args + "]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
+ "\"method\": \"" + methodname + "\", \"params\": [" + args + "]}' -H 'content-type: application/json;' http://127.0.0.1:8332/\n";
}
std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList& args)
@@ -187,7 +187,7 @@ std::string HelpExampleRpcNamed(const std::string& methodname, const RPCArgList&
}
return "> curl --user myusername --data-binary '{\"jsonrpc\": \"2.0\", \"id\": \"curltest\", "
- "\"method\": \"" + methodname + "\", \"params\": " + params.write() + "}' -H 'content-type: text/plain;' http://127.0.0.1:8332/\n";
+ "\"method\": \"" + methodname + "\", \"params\": " + params.write() + "}' -H 'content-type: application/json;' http://127.0.0.1:8332/\n";
}
// Converts a hex string to a public key if possible