WinCurl
A tool to convert your macOS/Linux cURL requests to a Windows equivalent.
WinCurl trims whitespace, escapes bad characters, replaces quotes, and replaces line continuation characters for Windows. Requires Javascript to be enabled in your web browser.
Install
Install the node module below or download the Javascript manually.
npm i wincurl
Usage
There are multiple ways to take advantage of WinCurl. Below is an example of what to expect.
Take this:
curl -X POST https://api.easypost.com/v2/shipments \ -u <YOUR_TEST/PRODUCTION_API_KEY>: \ -d 'shipment[to_address][id]=adr_...' \ -d 'shipment[from_address][id]=adr_...' \ -d 'shipment[parcel][id]=prcl_...' \ -d 'shipment[options][address_validation_level]=0'
And turn it into this:
curl -X POST https://api.easypost.com/v2/shipments ^-u <YOUR_TEST/PRODUCTION_API_KEY>: ^-d "shipment[to_address][id]=adr_..." ^-d "shipment[from_address][id]=adr_..." ^-d "shipment[parcel][id]=prcl_..." ^-d "shipment[options][address_validation_level]=0"
Website
View WinCurl in action here: https://justintime50.github.io/wincurl.
Manual Download
Download WinCurl and open the index.html
file in your browser (double click the file) and paste in your cURL request. Press convert and you'll have your Windows curl request output.
HTML Example
Use id's wincurl-input
and wincurl-output
to pass in curl data and get the converted data out.
<!-- Import WinCurl --> <!-- WinCurl Input -->Convert <!-- WinCurl Output -->
Development
# Lint the project npx eslint index.js # Test the project npm run test
Attribution
Source code came from roehnan with some small modifications.