Making curl requests to ganache server hosted locally

I’m trying to figure out how to make requests to a local ganache server. This is my first time using Ganache so forgive me if this should be obvious.

My end goal is to have a dedicated server hosting ganache, that I will be able to make curl requests to at any time. The hosted ganache server will be designed to fork mainnet every so often and respond to requests.

I’ve tried ganache-cli --fork which yields this in the terminal:

ganache v7.0.3 (@ganache/cli: 0.1.4, @ganache/core: 0.1.4)
Starting RPC server

Available Accounts
==================
(0) 0xbDF9C183567A386609e6e94d0aD13CeA8f374049 (1000 ETH)
(1) 0xe27b1B229b768Adca934CEd15faA0b3C5Cf48781 (1000 ETH)
(2) 0x637F0C83B8B682282E291Ce0DDb1E90b1cA7b106 (1000 ETH)
(3) 0xDa94450449dE31AF4ca977656d267991912f4e32 (1000 ETH)
(4) 0x9ef0A0392D8273221786A97a9E5C4c4Db0C1a713 (1000 ETH)
(5) 0x31b442a7e5799DE23F8925E5a40BCb6dea5B3092 (1000 ETH)
(6) 0xA011e621A9E298333266E190A7F2A85d7D24Bd84 (1000 ETH)
(7) 0x349A93BAC6e637e5b9405E7ea67d43E806bEF636 (1000 ETH)
(8) 0x55038A17ad748749E39BAb2aB22F957243cf3eC2 (1000 ETH)
(9) 0x2AfebF0d8020dCe1AA50FEf6B97624E1Bde5CBB7 (1000 ETH)

Private Keys
==================
(0) 0x0e79efa9a1a642978b194d8d2a81169dfd270ac91cc2263366bf36bc2fa364c6
(1) 0x5114080f5d56b72e56fa12bf058e921418425f17e2054a45a094ec7765da5336
(2) 0xbf2552187bed065e05528cc21790ab6df0eecbbb879374fb64ee6c9f0198cb8a
(3) 0x6198d636b7a7c292ff6f3c782a0e19e81ab51c3ef13453ac52afcb957284d24f
(4) 0x59a322108f123ac90beabd8842622d60bb42e2e53d31f1b93f8f4938933149c9
(5) 0xcca307c9935aa2587f7e356cd6de410d2133c45ecc783ca24d8598fafc2c1ad9
(6) 0x14304aa76ecb5626e6d2fa4292580d2f84e8fe0efee8c66903043a490ed41021
(7) 0xc382db92c9eaf40cc104f08292e47c290213044bb7998cd135f22788da8b99ff
(8) 0x7495fd3615831af0e0de59beaa56d813e71cf25db0f11069b195ca39fb9701b6
(9) 0x0351c7990ff699ad7a4d669667f426f96e0590f2c6ebd2b1241edb6317bba3a3

HD Wallet
==================
Mnemonic:      wrap tired exhaust oil seed teach comfort flash wasp error else still
Base HD Path:  m/44'/60'/0'/0/{account_index}        

Default Gas Price
==================
2000000000

BlockGas Limit
==================
30000000

Call Gas Limit
==================
50000000

Forked Chain
==================
Location:        Ethereum Mainnet, via 丕Infura      
Block:           14523327
Network ID:      1
Time:            Mon Apr 04 2022 22:46:30 GMT-0400 (Eastern Daylight Time)

Chain Id
==================
1337

RPC Listening on 127.0.0.1:8545

While this is still running, in a separate terminal, I’m running curl.exe http://127.0.0.1:8545 -X POST -H "Content-Type: application/json" -d '{"jsonrpc": "2.0", "method": "eth_accounts"}' just to test that I can get some kind of response (Note: using curl.exe because I had problems with curl in powershell). I always get this error 400 Bad Request: Unexpected token j in JSON at position 1

Is this an issue with ganache-cli being an rpc server rather than json-rpc? How can I start a server that is json-rpc in that case?

I’ve also tried making a server programmatically by following along with Ganache documentation that specifies that the code is designed to be a json-rpc server:

const ganache = require("ganache");

const options = {};
const server = ganache.server(options);
const PORT = 8545;
server.listen(PORT, async (err) => {
  if (err) throw err;

  console.log(`ganache listening on port ${PORT}...`);
  const provider = server.provider;
  const accounts = await provider.request({
    method: "eth_accounts",
    params: [],
  });
});

I get the same error when trying to make a curl request. Can someone help me figure out what I’m doing wrong?

Thanks!