The curl command with the -X or --request POST option is used to send a POST request to a server. Let's say www.example.com/index.php contains the following markup.
<?php echo $_POST['foo']; ?>
The curl command with the -d or --data option followed by a key:value pair would be used to send "foo" to www.example.com/index.php. This is the request.
curl -X POST http://www.example.com/index.php --data "foo=bar"
The www.example.com web server should send back "bar". this is the response.
The --url option is used to define the URL being requested. This option is typically not needed, thus the following commands both display the contents of the index.html page from the www.example.com web server.
curl -X POST http://www.example.com/index.html curl -X POST --url http://www.example.com/index.html
The following command can be used to determine the public certificate that was requested from a particular URL.
curl -X POST --verbose --insecure https://www.example.com
Let's say access to this page require basic authentication (username/password). The -u or --user option can be used to include a username and password in the request.
curl -X POST --user john.doe:itsasecret https://www.example.com/foo.html