In a Max/MSP module I have a simple Tcp client that sends data to a server. I want to use this to send a PUT request to my MIDI/OSC controller(an Eigenharp). It asks for the PUT request to make one of its lights turn on.
Now, the following works in cURL:
curl http://localhost:1024/column/1/row/5 -X PUT --data green
However,
How can I accomplish something like that using a basic TCP stream, without any extra libraries?
Here is a generic way to figure it out (which is, so to speak, a trowel instead of fish):
First,
which will begin listening to the tcp port 7070. Then (from a separate shell)
After that
ncwill print something like:Which is more or less what you need to send through the socket.
You can use the very same
nc(netcat) utility as a network Swiss-army knife as well to send the data:That said, HTTP RFC is your best friend.