Like in previous post I want to write little note about making request and file transfer via terminal on Mac and Linux OS.
Problem 1. Making POST request
There is useful command called wget. It can be used to make quick request to some page with POST values. So, let’s say that you want make request to page http://doszhan.com with POST parameters [“username” => “doszhan”, “password” => “passphrase”]:
wget http://doszhan.com --post-data 'username=doszhan&password=passphrase'
In case wget is not installed, you can install it on Mac by brew:
brew install wget
Problem 2. Upload/download file to/from server
Uploading file to remote server:
scp [path to local file/filename] user@[server IP address OR domain name]:/[path where to save on remote server]
Downloading file from remote server:
scp user@[server IP address OR domain name]:/[path to file/filename] [local path where to save]