HTTP coding

My company has an in house instant messaging system (like WhatsApp) where users can communicate with each other. I currently have code to email me certain items from my Sparc machine running SunOS 5.10. I want what I am emailing myself to now instant message me. The team that created the messenger has provided a blanket code to get this working. I know shell but not much as far as http stuff is concerned. The code they provided has a "curl" command in it. Apparently my OS doesn't support "curl". Can anybody provide an "curl" equivalent for my OS? Here is the code and notes that the messenger creators sent:

FROM_USERID=$1
FROM_PASSWORD=$2
TO=$3
MSG=$4
BOT_SERVICE="http://bots.q.mycompany.com:8011/QBotService/BotTalk"

MESSAGE="xmlMessage=<message \
type=\"contact.send.message\" \
id=\"$FROM_USERID\" \
password=\"$FROM_PASSWORD\" \
contactId=\"$TO\"> \
<statement from=\"$FROM_USERID\" \
to=\"$TO\" \
text=\"$MSG\"/></message>"

## echo $MESSAGE - uncomment this if debugging, to see the string sent to the Bot Service

## (1) use this command to suppress display of the response
curl -s -d "${MESSAGE// /%20}" $BOT_SERVICE   > /dev/null   

## (2) use this command to display the response from the Bot Service - helpful for debugging
## curl -s -d "${MESSAGE// /%20}" $BOT_SERVICE  

Here are the notes:

Just send this via HTTP or HTTPS to: http://bots.q.mycompany.com:8011/QBotService/BotTalk
It's best to use HTTPS and POST, but you can also send it via HTTP GET with ?xmlMessage=<xml here...>

There's more than curl to POST messages, try lynx or - although not designed therefor - wget , if available on your system.

So I swapped 'curl' with 'wget' and get the following error. Ironically I get the same error with the 'curl' version:

"${MESSAGE// /%20}": bad substitution

That's a shell error msg, not curl nor wget . What shell are you using?

And, wget does have other options that curl has. Read man wget on how to POST messages.

Apparently there is: cURL - Download

also see https://www.opencsw.org/package/curl/

I hope this helps.

bakunin

I'm using KornShell.