FreeKB - Linux Commands curl (POST)
Linux Commands - curl (POST)

The curl command with the -X or --request POST option is used to send a POST request to a server. Let's say contains index.php with following markup.

<?php echo $_POST['foo']; ?>


The following curl command would display "bar".

curl -X POST --data "foo=bar"
. . .



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 web server.

curl -X POST
curl -X POST --url


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter ec29e in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |