By using GitHub, not only we can get the latest stable release version of Docker, we can also obtain other projects. In fact, if the project was hosted in GitHub, and it was tagged properly with the releases, you can use this method to obtain the version. However, if it’s not properly tagged, such as Node.js, you need to find another way.
Redirect or pipe the content of a file or the output of another command as the input of cURL, for example, making a POST request with cURL.
This is done by prefixing the data parameter with @, the rest is the filename to read data from. With -, the data is coming from stdin:
$ seq 17000117001 | \
--request POST \
--header 'Content-Type: application/json' \
--data-binary @- \
Command seq 17000 1 17001 returns:
The size of the above two numbers is 12 bytes (including two newlines). But when reading data via @ with --data option, “carriage returns and newlines will be stripped out” . If you check your server, you will see the content length is only 10 bytes.
To correct this problem, we will send the raw data using --data-binary option instead. This preserves \n and \r characters.