FreeKB - Curl -d --data (post or put data)
Curl - -d --data (post or put data)

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

  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 This is the request.

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


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

curl -X POST
curl -X POST --url


Public Certificate

The following command can be used to determine the public certificate that was requested from a particular URL.

curl -X POST --verbose --insecure



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


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 01280 in the box below so that we can be sure you are a human.


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