How do I use the getblocktemplate RPC command of Bitcoin Core GUI? I tried the following usages but none of them worked
The GUI's debug console operates similarly to a shell. It needs quotes around the entire JSON string so that it is first interpreted as a string before the JSON is parsed. Then, if you used double quotes, you need to escape the quotes that are part of the JSON so that they aren't misinterpreted.
A valid way of writing this command is
getblocktemplate &quot;{\&quot;rules\&quot;:[\&quot;segwit\&quot;]}&quot;

Alternatively, to avoid additional escaping, you can use single quotes on the outside:
getblocktemplate '{&quot;rules&quot;:[&quot;segwit&quot;]}'