https://github.com/anderly/powercurl
A simple curl-like module for PowerShell
https://github.com/anderly/powercurl
Last synced: 8 months ago
JSON representation
A simple curl-like module for PowerShell
- Host: GitHub
- URL: https://github.com/anderly/powercurl
- Owner: anderly
- Created: 2011-08-21T04:59:20.000Z (almost 15 years ago)
- Default Branch: master
- Last Pushed: 2011-08-22T07:29:18.000Z (almost 15 years ago)
- Last Synced: 2025-03-30T11:12:06.442Z (about 1 year ago)
- Homepage:
- Size: 187 KB
- Stars: 5
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PowerCurl
A simple curl-like module for PowerShell.
## Why
I've been working with Twilio and a bunch of other rest APIs and wanted an easy way to test them without having to leave Visual Studio. So, I figured why not build a basic curl-like PowerShell module (using the same command-line signature) and deliver it via NuGet so that it can be used via the NuGet Package Manager console.
## Usage
Just like curl:
powercurl -X -u :
Thanks to PowerShell, you can also use one of 3 other defined aliases (pcurl, curl, pc):
pcurl -X -u :
or
curl -X -u :
or
pc -X -u :
## Example using Twilio Rest API
pcurl -X GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}.xml' -u {AccountSid}:{AuthToken}
or
pcurl -X GET 'https://api.twilio.com/2010-04-01/Accounts/{AccountSid}.json' -u {AccountSid}:{AuthToken}
## Benefits of PowerShell
Using the Twilio example above, you could easily parse this xml using:
([xml](pcurl -X GET https://api.twilio.com/2010-04-01/Accounts/{AccountSid}.xml -u {AccountSid}:{AuthToken})).TwilioResponse.Account
PowerShell Output:
Sid : {AccountSid}
FriendlyName : {Your Account Name}
Status : {active | suspended | closed}
DateCreated : {DateCreated}
DateUpdated : {DateUpdated}
AuthToken : {AuthToken}
Type : {Type}
Uri : /2010-04-01/Accounts/{AccountSid}.xml
SubresourceUris : SubresourceUris
## Disclaimer
This is by no means a full implementation of all of curl's features. Initially, I plan to support basic HTTP GET, POST, PUT, DELETE, etc. If you want to see more, fork me and feel free to add to it.
## Copyright
Copyright (c) 2011 Adam Anderly
## License
MS-PL