Send message from linux terminal to some web server
Solution 1
If you want to stick with built in tools use wget and refer to this SO post about posting data with wget: How to get past the login page with Wget?.
You're going to have to send your data in the post data section and format it on your server side PHP script.
Solution 2
The man page for wget has some examples, e.g.
wget --save-cookies cookies.txt \
--post-data 'user=foo&password=bar' \
http://server.com/auth.php
Solution 3
curl and wget can be used for performing http requests from the shell.
You may want to use some sort of authentication and encryption mechanism to avoid abuse of the URL
Solution 4
This is what curl
is good at.
Solution 5
You can use curl for this purpose. Have a look at the --data*
and --form
options in the manpage.
Mike
Nothing really special. Really close to getting my degree and looking forward to it.
Updated on September 05, 2022Comments
-
Mike over 1 year
I am trying to figure out how I can post a message to an http server from the linux shell. What I want is for the shell to post the message and then I can write a small php program to reroute the message to its intended recipient based on the contents and the sender. I cant seem to find a command to do this in Linux. I would really like to stick to a built in utility.
If there is a better frame work that you can think of please let me know.
Thanks