If you want to run curl on the EC2 instance, and tunnel the output via ssh, then try the following:
ssh ${USERNAME}@${EC2_INSTANCE_IP} curl -s http://localhost:8000/
You should see the result directly on the terminal (-s will inhibit curl's output).
You can run any command like this, there's nothing special for curl.
If this works, then you can alter the curl parameters to use -X POST and/or -d, along with the correct endpoint.
Please remember though, that 0.0.0.0 is a "special" address that actually means "listening on all interfaces"... So unless you configure the inbound rules correctly, anyone can still do curl http://${EC2_INSTANCE_IP}:8000/ and hit your server.
0.0.0.0:8000" means "listening on all interfaces" - so can you communicate with it on it's public IP? (the same you would use for SSH) – Attie Oct 17 '18 at 14:08no port specified, defaulting to port 8000that lives in the ec2 instance. I would like to do thecurl -XPOSTfrom an "external machine" – anon Oct 17 '18 at 14:10curlwith the same IP you used for SSH? – Attie Oct 17 '18 at 14:11