Do the following steps to install cURL on a Windows OS. I mainly use cURL on Windows Servers to notify me of certain events via API.
Installing cURL
- Download cURL
- Make sure to download the one from: Viktor Szakats
- Extract the contents to: c:\curl
- Download the cacert.pem
- Extract this to where curl.exe is located. Typically, this is located in c:\curl\bin
- Rename this file to: curl-ca-bundle.crt
Add as Environment Variable
Credits to CharlesNadeau on the following guide.
- In the Start menu, right-click This PC and select More > Properties.
Note: In Windows 7, right-click Computer and select Properties. - Click Advanced System Settings.
- In the Advanced tab, click the Environment Variables button on the lower right side.
- Select the “Path” variable in System Variables, and click Edit.
- In the Edit environment variable dialog box, click New and add the path to the curl.exefile. Example: C:\curl.
Slack Notification API Example
Use the following to send a curl to a Slack hook.
C:\curl\curl-7.59.0-win64-mingw\bin\curl.exe -k -g -X POST -d "payload={\"text\":\"This is the notification in the body of Slack.\", \"channel\":\"#channel\", \"username\":\"FIRSTNAME LASTNAME\", \"icon_emoji\":\":thumbsup:\"}" https://hooks.slack.com/services/API_URL