Site icon The Perpetual Student

Installing cURL on Windows for Slack Notifications

Macbook Pro Pexels

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

Add as Environment Variable

Credits to CharlesNadeau on the following guide.

  1. In the Start menu, right-click This PC and select More > Properties.
    Note: In Windows 7, right-click Computer and select Properties.
  2. Click Advanced System Settings.
  3. In the Advanced tab, click the Environment Variables button on the lower right side.
  4. Select the “Path” variable in System Variables, and click Edit.
  5. 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

Credits:

Exit mobile version