How do I install just the client tools for PostgreSQL on Windows? - windows

I have a PostgreSQL database on a Linux system that I want to access from my Windows PC. But the only Windows binaries I have been able to find are the full installer, which includes the database server and client.
Is it possible to get a client-only Windows binary install for PostgreSQL from anywhere?
(To clarify, I want the standard PostgreSQL client, psql - not a GUI client or independent tool).

Unfortunately there is no real client "only" installer.
What you can do, is to download the ZIP archive of the complete Postgres binaries:
http://www.enterprisedb.com/products-services-training/pgbindownload
and then remove the "server" part from it.
When you unzip it, you get the following directories:
bin
doc
include
lib
pgAdmin III
share
StackBuilder
symbols
You can remove the doc, include, pgAdmin III, StackBuilder and symbols directories. As far as I can tell (but I am not sure) the client also doesn't need the share or lib directories, but you would need to test that. So that leaves only the bin directory.
I think the share directory could be needed for localized error messages in psql but I'm not sure about that.
Inside the bin directory you can essentially remove all .exe files (except psql.exe of course). You can also remove all wx*.dll files, they are only needed for pgAdmin. The libxml2.dll and libxslt.dll are also only needed for the server.
If you do want some of the other client tools, you might want to keep
pg_dump.exe
pg_dumpall.exe
pg_restore.exe
One drawback of this approach is that this requires the Visual C++ Redistributable to be installed. But you can overcome that as well by simply putting the MSVCR120.DLL from some computer where it is installed into the bin directory.
So that leaves you with these files (from the bin directory) that are required for the psql client:
iconv.dll (libiconv-2.dll in newer Postgres versions)
libeay32.dll
libintl-8.dll
libpq.dll
msvcr120.dll
ssleay32.dll
zlib1.dll
psql.exe
Of course you can also take all that from an existing Postgres installation without the need to download the ZIP archive.
It is obviously not a real installer, but if you put the cleaned up directory into a ZIP file, you can distribute that and whoever needs it just unzips the archive. Personally I find unzip to be the best "installer" anyway (I also use that to install the Postgres server, the Windows installer just has too many quirks)

As of 2020, when you click download the full installer from here , click next and next and you get the option to install only the command line - tools
. Remember to add the path to the bin folder in the PATH variable.

Actually there are client CLI tools in pgAdmin. All you need is just to install it on your Windows machine from https://www.postgresql.org/download/windows/.
Then you'll be able to find those tools in folder like C:\Program Files (x86)\pgAdmin III\1.22 or C:\Program Files (x86)\pgAdmin 4\v2\runtime, depends on the pgAdmin version you have installed.

Thanks to everyone who has posted on this thread.
For what it's worth, I got psql.exe from PostgreSQL 10.10 working under Windows 10 with just the following files from the zip archive:
libcrypto-1_1-x64.dll
libiconv-2.dll
libintl-8.dll
libpq.dll
libssl-1_1-x64.dll
psql.exe
When connecting to AWS Redshift, I got the following error:
psql: FATAL: invalid value for parameter "client_encoding": "WIN1252"
I resolved this by running
set PGCLIENTENCODING=UTF8
I found this solution at https://forums.aws.amazon.com/thread.jspa?messageID=600088
HTH.

I realize this is an older question, but when I used the Windows installer for the latest version of Postgres (10.4), it gave me the option to install just the command line tools. I just unchecked server and pgadmin in the installer's window when prompted to choose what I wanted to install.

Below are the steps I followed to connect to Amazon Redshift with postgres12 psql on windows:
download postgres 12.4 from below location:
https://www.enterprisedb.com/downloads/postgres-postgresql-downloads
run the installer which will take few minutes and prompt you for installations options
select command line tools as shown in below screenshot and install that
Above will install postgres12 command line in below folder C:\Program Files\PostgreSQL\12\bin. Make sure to add this to your PATH environment variable
open cmd and run command
set PGCLIENTENCODING=UTF8
run psql to connect to redshift. Make sure to change below parameters highlighted in red for your cluster endpoint, userid, copy script file name and log script file name respectively
psql -h redshift-cluster-1.abcdefgh.us-east-1.redshift.amazonaws.com -U demo_user -d dev -p 5439 -f d:\demo\redshift_script.sql -L d:\demo\log_redshift_script.log
all commands in redshift_script.sql file would get executed in PSQL and logs will be stored in log_redshift_script.log file

There is a third-party command-line tool available known as PGCLI - A command-line interface for Postgres with auto-completion and syntax highlighting.
Install:
pip install pgcli
Connect to POSTGRES Server from Command-line:
pgcli -h localhost -U xyz -d app_db
For official documentation, visit PGCLI

If there's pgadmin v4 installed then just copy these libraries (from C:\Program Files\pgAdmin 4\v4\runtime\):
libcrypto-1_1-x64.dll
libpq.dll
libssl-1_1-x64.dll
These were enough for me to connect from a client Windows 10 x64 PC to a remote Postgres 13 server. Note, that libraries coming with the ZIP archive mentioned above are slightly different and have more dependencies.

I kind of cheat. I install sqlbackupandftp.com on a Windows server - which has a free version that can schedule a single database backup. In the binaries, pg_dump.exe is there - typically on the C: drive like C:\Program Files (x86)\SQLBackupAndFTP\dbms\PostgreSql

I built standalone versions for windows and linux.
It has less dll dependecies and smaller size and work with many linux.
https://github.com/hemnstill/StandaloneTools/releases?q=pg_dump

You can also download "https://www.nuget.org/packages/Postgres.psql" nuget package to get "psql.exe"

Related

mingw-w64 installer "the file has been downloaded incorrectly"

I am trying to install mingw-w64 onto Windows. However I receive an error, "the file has been downloaded incorrectly". Redownloading the setup file again from sourceforge does not fix the problem. Is there an alternative way to install it or am I doing something wrong?
Old post but same problem, the installer doesn't seem to work.
I give the solution which works for me
You can directly download the archive of MinGW64 with your chosen configuration :
https://sourceforge.net/projects/mingw-w64/files/mingw-w64/
Once the compressed file downloaded, you have just to extract and copy/paste the MinGW64 folder( with the pre-compiled librairies) to your chosen folder ( in my case : C:\mingw64)
I got same error and solved it, after struggling a few hours. You should download MinGW64 via https://winlibs.com/#download-release.
After downloading, You should unzip mingw64 file to a folder(in my case I unzipped it to c disk; C:\mingw64)
And then you have to set up path. for that follow below steps;
open settings.
Search for Edit environment variables for your
account.
choose path variable and then select edit.
Select New and add the Mingw-w64 folder path(bin folder). In my case, I added (C:\mingw64\bin).
Select OK to save the updated path.
And reopen your cmd, then check if everything is good by typing; gcc --version
Long story short, the official installer is broken and not been fixed for years, so we have to install it manually.
The official download link above would bring you to sourceforge: https://sourceforge.net/projects/mingw-w64/files/Toolchains targetting Win32/Personal Builds/mingw-builds/installer/mingw-w64-install.exe
And in the same folder that contains the installer, there's a repository.txt. (about this file)
Take a look at it, the installer basically just download and unzip the build from one of these urls within repository.txt. Choose the url you want and download/upzip it manually. (In my case, I use 8.1.0|x86_64|posix|seh|rev0 setup)
Last, setup the Path environment variable pointing to your unzipped bin folder, let say C:\mingw64\bin, and this should do the trick.
Finally, I solved this problem by downloading this:http://winlibs.com/
GCC 10.1.0 + LLVM/Clang/LLD/LLDB 10.0.0 + MinGW-w64 7.0.0 - release 3 (LATEST)
Win32: 7-Zip archive* | Zip archive
Win64: 7-Zip archive* | Zip archive
and set the %path%
After that, I still can't execute gcc correctly, but then I solved the problem by adding this environment variable:
"CGO_ENABLED=1"
I encountered the problem when using this golang package: https://github.com/mattn/go-sqlite3
I received the same error. When I re-ran the installer as an adminstrator it was installed successfully.
I also made sure not to add any spaces to the installation path.
Following this tutorial helped me manually install MinGW for windows : youtube
So the problem for me was that when I tried to use the .exe installer, it either showed me that,
"the file has been downloaded incorrectly" , or , the /.../bin folder did not have any files in it.
In the link above, the MinGW files (including the /bin files) were manually downloaded and identified properly by the Environment Variables.
The problem is with your internet connection and/or ISP. I'm not great at networking so I'll let others be more specific. I tried installing/downloading it using my mobile's data as wifi hotspot and it worked. Hope it helps

mosquitto (on windows) command not found

I'm a newbie to MQTT and mosquitto.
I recently installed mosquitto on my Windows OS using the Windows binary installation file on the website (http://www.eclipse.org/downloads/download.php?file=/mosquitto/binary/win32/mosquitto-1.4.2-install-win32.exe).
However, when I try to run the mosquitto commands, it displays an error saying that the command is not found. Upon Googling this, I found the same instructions to download the binary installation.
Even when I open the mosquitto folder saved in my Program Files and try to run the broker application, the window opens for a split second and then shuts off.
I also have HiveMQ downloaded. Could that be the issue?
I cannot understand what I might have done wrong during the installation otherwise. Please help!
None of mosquitto, mosquitto_pub nor mosquitto_pub are gui programs. You will need to run them through cmd.exe or powershell or similar. So for example:
run cmd.exe
cd <path to executables>
mosquitto_sub -h test.mosquitto.org -t '#'
On the "command not found" error, did you follow the instructions in the installer for installing dependencies?
OpenSSL - install 'Win32 OpenSSL vXXXXX Light' then copy dlls to the mosquitto directory - http://slproweb.com/products/Win32OpenSSL.html
pthreads - copy 'pthreadVC2.dll' to the mosquitto directory ftp://sources.redhat.com/pub/pthreads-win32/dll-latest/dll/x86/
As per the readme-windows.txt file (found under the installation director), the dependencies (OpenSSL abd Pthread) are not provided with the installer and needs to be installed separately:
libeay32.dll ssleay32.dll from open ssl (Download the OpenSSL from here and copy/paste these two dlls under mosquitto installation director)
pthreadVC2.dll (download the dll from here and paste under mosquitto installation director)
do not install win64openSSL, even you do have 64bit OS :)
as far as mosquitto is 32bit app, it will work with Win32OpenSSL only ...

I can't "go get" a dependency from github

I made a golang app on my machine that uses cron. On my machine, I
"go get github.com/robfig/cron"
to download and install dependency then in my app I
"import cron "github.com/rk/go-cron""
the app works fine and runs the way I want. I then upload it to the server where it's supposed to run and try to "go get github.com/robfig/cron" as I did on my machine, but then it gave me this
I downloaded and installed github but still the same result. I'm guessing the problem is with github on my server machine
I am new to golang and andy kind of help would be greatly appreciated. Thanks.
What you need to install is git. It is the version control system (VCS) used by GitHub.
The native GitHub application does not provide the command line tools used by Go.
Git can be found and downloaded at http://git-scm.com/downloads
Once installed, make sure you have the path to the Git cmd folder in your %PATH% environment variable.
You can check this by running the command: echo %PATH%
On a Windows installation, you might find it located here:
C:\Program Files (x86)\Git\cmd

How to install plugin for MobaXterm?

I need a terminal that will support svn on windows and I found that MobaXterm is one of them. However going to their plugin installation page which says:
To install these plugins, just download them and put them in the same directory than the MobaXterm executable.
So I downloaded it and put it in the file
C:\Program Files (x86)\Mobatek\MobaXterm Personal Edition however I still get the error message
Sorry: Svn is not included in this version of MobaXterm.
You can check online if you find a Svn plugin for MobaXterm
by ctrl+clicking here: http://mobaxterm.mobatek.net .
If you need a custom version of MobaXterm that includes Svn,
do not hesitate to ask us for a quotation: mailto:contact#mobatek.net .
Does anyone have experience with this software or recommended a terminal that can support svn in windows?
You need to go into the C:\Program Files (x86)\Mobatek\MobaXterm Personal Edition or whichever edition you have and place the plugin there. Restart MobaXterm and it should work.
I normally collect all the plugins which I require from http://mobaxterm.mobatek.net/plugins.html
Once the .mxt3 files are getting downloaded, I moved them to the installed folder where the MobaXterm_.exe is there.
After restarting MobaXterm, this will work like a champ.
Hope if this solves your issue faster.
Start MobaXterm terminal.
Type MobApt or apt-get. This will open MobApt package manager.
Once in the package manager, you have a variety of tools/commands that you can install by simply selecting and pressing Install/Update.
i know the question is old. but you should put the plugin into your home.
if you check the setting you see this is the home directory
%CurrentDrive%:\Users\USERNAME\Documents\MobaXterm\home
witch is :
C:\Users\USERNAME\Documents\MobaXterm\home -- or whatever drive that u installed windows
i just installed the python plugin and it works fine
In Mobaxterm simply type : apt-get install subversion
Usable just right after installation. No need to restart.
Same for git.
Change the name of the .mxt3 file (that you downloaded) to .zip
Extract the files, get the .exe files you want from the bin folder
from the files you just extracted, and add them to the slash/bin
folder of the Mobaxterm (where there are more .exe files)
Restart
In order to finish your plugin installation, you need to restart MobaXterm. After restarting, type "svn" in the terminal and it should work.
Try run the command:
#unalias svn
When I saw $PATH and looked into its directories, there was no git.exe.
I downloaded git.mxt3 and put in program files (86) folder and restarted mobaterm.
After restart I can see a file named git.exe in my /bin folder. I am using Win7 (64 bit) and mobaXterm personal Edition v7.1 installed using windows installer (not portable )
MobaXterm already has a 'Packages' button where you can search for plugins and download them. You don't need to go to github and other places to find the necessary files. Just using the built-in search feature under the 'Packages' option at the top of MobaXterm.

How do I install and use cURL on Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am having trouble getting cURL to run on Windows.
I have downloaded a cURL zip file from here, but it seems to contain source code, not an executable.
Do I need to compile cURL to run it? If yes, then how do I do that?
Where can I find .exe downloads for cURL ?
I have looked for documentation on installing cURL, but there is little to be found.
You might already have curl
It is possible that you won't need to download anything:
If you are on Windows 10, version 1803 or later, your OS ships with a copy of curl, already set up and ready to use.
If you have Git for Windows installed (if you downloaded Git from git-scm.com, the answer is yes), you have curl.exe under:
C:\Program Files\Git\mingw64\bin\
Simply add the above path to PATH.
Installing curl with a package manager
If you are already using a package manager, it may be more convenient to install with one:
For Chocolatey, run choco install curl
For MSYS2, run pacman -S curl
For Scoop, run scoop install curl
For Cygwin, add the curl package in Cygwin Setup. EDIT by a reader: Cygwin installer design has changed, please choose curl packages as follows:
Installing curl manually
Downloading curl
It is too easy to accidentally download the wrong thing. If, on the curl homepage, you click the large and prominent "Download" section in the site header, and then the large and prominent curl-7.62.0.tar.gz link in its body, you will have downloaded a curl source package, which contains curl's source code but not curl.exe. Watch out for that.
Instead, click the large and prominent download links on this page. Those are the official Windows builds, and they are provided by the curl-for-win project.
If you have more esoteric needs (e.g. you want cygwin builds, third-party builds, libcurl, header files, sources, etc.), use the curl download wizard. After answering five questions, you will be presented with a list of download links.
Extracting and setting up curl
Find curl.exe within your downloaded package; it's probably under bin\.
Pick a location on your hard drive that will serve as a permanent home for curl:
If you want to give curl its own folder, C:\Program Files\curl\ or C:\curl\ will do.
If you have many loose executables, and you do not want to add many individual folders to PATH, use a single folder such as C:\Program Files\tools\ or C:\tools\ for the purpose.
Place curl.exe under the folder. And never move the folder or its contents.
Next, you'll want to make curl available anywhere from the command line. To do this, add the folder to PATH, like this:
Click the Windows 10 start menu. Start typing "environment".
You'll see the search result Edit the system environment variables. Choose it.
A System Properties window will popup. Click the Environment Variables button at the bottom.
Select the "Path" variable under "System variables" (the lower box). Click the Edit button.
Click the Add button and paste in the folder path where curl.exe lives.
Click OK as needed. Close open console windows and reopen, so they get the new PATH.
Now enjoy typing curl at any command prompt. Party time!
Assuming you got it from https://curl.haxx.se/download.html, just unzip it wherever you want. No need to install. If you are going to use SSL, you need to download the OpenSSL DLLs, available from curl's website.
Download curl zip
Extract the contents (if you have downloaded the correct version you should find curl.exe)
Place curl.exe in a folder where you keep your software (e.g. D:\software\curl\curl.exe)
To run curl from the command line
a) Right-hand-click on "My Computer" icon
b) Select Properties
c) Click 'Advanced system settings' link
d) Go to tab [Advanced] - 'Environment Variables' button
e) Under System variable select 'Path' and Edit button
f) Add a semicolon followed by the path to where you placed your curl.exe (e.g. ;D:\software\curl)
Now you can run from the command line by typing:
curl www.google.com
Starting with Windows 10 version 1803 (and earlier, with insider build 17063), you don't install curl anymore. Windows includes a native curl.exe (and tar.exe) in C:\Windows\System32\, which you can access right from your regular CMD.
C:\Users\vonc>C:\Windows\System32\curl.exe --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
C:\Users\vonc>C:\Windows\System32\tar.exe --version
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
See the initial announcement and the release announcement.
The simplest tutorial for setting up cURL on Windows is the Making cURL work on Windows 7. It only have 3 easy steps.
Download cURL (Win64 ia64 zip binary with SSL)
Extract curl.exe into "C:\Windows\System32"
Done
Even more easier:
Download the Win64 2000/XP x86_64 MSI installer provided by Edward LoPinto.
At the time of writing file curl-7.46.0-win64.exe was the most recent. Tested with Windows 10.
It's probably worth noting that Powershell v3 and up, contains a cmdlet called Invoke-WebRequest that has some curl-ish capabilities. The New-WebServiceProxy and Invoke-RestMethod cmdlets are probably worth mentioning too.
I'm not sure they will fit your needs or not, but although I'm not a Windows guy, I have to say I find the object approach PS takes, a lot easier to work with than utilities such as curl, wget etc. They may be worth taking a look at
Note also that installing Git for Windows from git-scm.com also installs Curl. You can then run Curl from Git for Windows' BASH terminal (not the default Windows CMD terminal).
As you already know, you can find several packages of binaries on the official curl website.
Once you download a package, unzip it wherever you want. I recommend adding its location to your path, so you can call curl from batch or powershell scripts. To add a directory to your path type "environment variables" in the start menu, and select "edit user environment variables". Select Path, and add to the end of the "value" box: ;C:\curl\directory (with the directory changed to where you saved curl.)
If you want to use SSL you need a certificate bundle. Run either mk-ca-bundle.pl (perl) or mk-ca-bundle.vbs (VBScript). Some of the packages of binaries include one or both of them. If your download doesn't include one, download one here: https://github.com/bagder/curl/tree/master/lib. I recommend mk-ca-bundle.vbs, as on windows you simply double click it to run it. It will produce a file called ca-bundle.crt. Rename it curl-ca-bundle.crt and save it in the directory with curl.exe.
Alternatively, I recently developed an msi installer that sets up a full featured build of curl with just a few clicks. It automatically ads curl to your path, includes a ready-to-use ssl certificate bundle, and makes the curl manual and documentation accessible from the start menu. You can download it at www.confusedbycode.com/curl/.
Install Chocolatey package manager for Windows. Once installed, simply enter choco install curl. Then you can use curl from a terminal.
Thought I'd write exactly what I did (Windows 10, 64-bit):
From the download page https://curl.haxx.se/download.html choose the download wizard https://curl.haxx.se/dlwiz/
Choose curl executable.
Choose Win64.
Choose generic.
Choose any.
Choose x86_64.
Choose the first recommended option. For me this was:
curl version: 7.53.1 - SSL enabled SSH enabled. Provided by: Viktor Szakáts. This package is type curl executable You will get a pre-built 'curl' binary from this link (or in some cases, by using the information that is provided at the page this link takes you). You may or may not get 'libcurl' installed as a shared library/DLL.
The file is packaged using 7zip. 7zip is a file archiving format.
Click download.
You should have the file curl-7.53.1-win64-mingw.7z in your downloads folder.
Install 7-Zip if you don't have it.
Right-click, 7-Zip, Extract Here. Copy and paste the extracted file somewhere like Z:\Tools\
If you look in the bin folder you'll see curl.exe. If you double-click it a window will quickly flash up and vanish. To run it you need to use the Command Prompt. Navigate to the bin folder and type curl followed by your parameters to make a request. You must use double-quotes. Single quotes won't work with curl on Windows.
Now you'll want to add curl to a user's Path variable so you don't have to navigate to the right folder to run the program. Go to This PC, Computer, System Properties, Advanced system settings, authenticate as an administrator (you're not running as admin, right? Right?) Environment Variables, System variables, look at the list and select Path, then Edit, then New, then, e.g.
Z:\Tools\curl-7.53.1-win64-mingw\bin
You can add a trailing backslash if you like, I don't think it matters. Click move up until it's at the top of the list, then you can see it easily from the previous screen. Click OK, OK, OK, then crack open a Command Prompt and you can run curl by typing curl from any folder, as any user. Don't forget your double-quotes.
This is the answer I wish I'd had.
You can build the latest version of curl, openssl, libssh2 and zlib in 3 simple
steps by following this tutorial.
Curl is built statically so you do not have to distribute the prerequisite dynamic runtime.
You can also download a prebuilt version (x86 and x64) from SourceForge.
I had a lot of issues with curl for Windows. I finally used Cygwin, which includes curl by default.
I was looking for the download process of Curl and every where they said copy curl.exe file in System32 but they haven't provided the direct link. so here it is enjoy, find curl.exe easily in bin folder just
unzip it and then go to bin folder there you get exe file
link to download curl generic
This installer made it easy for me
http://www.confusedbycode.com/curl/
The link describes how to use it. Here's a summary taken from the website above:
"You can install cURL for Windows with only a few clicks. Just download and run an installer from the table below, and click Install. The default installation includes:
curl.exe
an SSL certificate bundle (ca-cert-bundle.crt)
SSL certificate bundle generation scripts (mk-ca-bundle.pl & mk-ca-bundle.vbs)
HTML manuals for cURL and libcurl
text documentation formatted for Windows (so you can simply double click the files to read them with Notepad)
Start Menu folder with shortcuts to the cURL installation folder, manuals, documentation, and uninstaller
cURL added to your path, so you can use it with batch or PowerShell scripts and call it from the command prompt in any working directory
To include developers' files in your installation, click Advanced. The developers' files include libcurl.dll, libeay32.dll, ssleay32.dll, libssh2.dll, zlib.dll, msvcr120.dll, C headers, libs, and code examples.
When you click Advanced you can also choose whether or not to install the documentation and manuals, and whether or not to add cURL to your path.
If you don't have administrator privileges on your computer, use one of the files from the "Without Administrator Privileges" row. These install cURL in C:\Users\Name\AppData\Local\Apps.
If you do not want to use the installer, but still want the contents listed above, you can download one of the zip archives."
Just download curl and extract the compressed file. You will get the file "curl.exe". Open a CMD Shell, drag the file curl.exe into the CMD Shell, now you can use curl.
After adding curl.exe's path to the System Variable 'Path'
you can open command prompt and run 'curl -V' to see if it is working.
Follow download wizard
Follow the screens one by one to select type of package (curl executable), OS (Win64), flavor (Generic), CPU (x86_64) and the download link.
unzip download and find curl.exe (I found it in src folder, one may find it in bin folder for different OS/flavor)
To make it available from the command line, add the executable path to the system path (Adding directory to PATH Environment Variable in Windows).
Enjoy curl.
Statically built WITH ssl for windows:
http://sourceforge.net/projects/curlforwindows/files/?source=navbar
You need curl-7.35.0-openssl-libssh2-zlib-x64.7z
..and for ssl all you need to do is add "-k" in addition to any other of your parameters and the bundle BS problem is gone; no CA verification.
I have successfully used Windows curl-installer: http://open-edx-windows-7-installation-instructions.readthedocs.io/en/latest/6_Install_cURL_for_Windows.html
by using cURL for Windows direct download link with msi-installer.
Remember to reboot your system after installing.
Download curl for windows from the path : https://curl.haxx.se/windows/
Unzip and you will find the ..\bin\curl.exe
Add ...\bin\ to your path variable for easy global access
I tried to install curl in many ways but finally started using gitbash terminal for curl commands.
I followed #theglauber's answer (the most popular one) but on Windows 10 Terminal / PowerShell the Environment setting did not take effect.
I had to CD into the GIT location and also use .\ like below:
PS C:\Program Files\Git\mingw64\bin> .\curl -X POST https://6sl8yohih.execute-api.us-west-1.amazonaws.com/dev/hello
I did not have any issues on the regular command prompt though.
Just posting this as an answer for someone who might be struggling as I did.

Resources