There are many different ways to send JSON with curl. Consult your API documentation to check which method you should use.
Here are some common ones:
sending json in a application/x-www-form-urlencoded POST request can be done like:
curl http://example.com --data-urlencode json='{"foo":"bar"}'
the request will then look like:
POST / HTTP/1.1
Host: example.com
User-Agent: curl/7.87.0
Accept: */*
Content-Length: 32
Content-Type: application/x-www-form-urlencoded
json=%7B%22foo%22%3A%22bar%22%7D
json in a multipart/form-data POST request can be done like:
curl http://example.com --form json='{"foo":"bar"}'
the request will then look like
POST / HTTP/1.1
Host: example.com
User-Agent: curl/7.87.0
Accept: */*
Content-Length: 152
Content-Type: multipart/form-data; boundary=------------------------ca36a58e4d11c82e
--------------------------ca36a58e4d11c82e
Content-Disposition: form-data; name="json"
{"foo":"bar"}
--------------------------ca36a58e4d11c82e--
sending raw json in a POST request can be done like:
curl --header 'Content-Type: application/json' --request POST --data-binary '{"foo":"bar"}'
the request will then look like
POST / HTTP/1.1
Host: example.com
User-Agent: curl/7.87.0
Accept: */*
Content-Type: application/json
Content-Length: 13
{"foo":"bar"}