curlformat
CLI utility to clean up your 'Copy as cURL' strings
Last updated 6 years ago by rstacruz .
MIT · Original npm · Tarball · package.json
$ cnpm install curlformat 
SYNC missed versions from official npm registry.

npm install -g curlformat

I like to do this in Firefox or Chrome. The output is unreadable though.

image

So what?

This untangles that. Type f in your terminal, then paste the curl command. Your command line should look like this:

$ fcurl 'http://site.com/article/new' -H 'Host: site.com' -H 'Connection: 
keep-alive' -H 'Accept-Language: en-us' -d "title=Hello&body=Welcome%20to%20" ...

BAM! Now its readable!

http POST "http://site.com/article/new" \
  title="Hello" \
  body="Welcome to my site!"

That's sweet.

I know. Now pass --extended to make print more stuff that would've been supressed.

http OPTIONS "http://site.com/users" \
  Connection:"keep-alive" \
  Access-Control-Request-Method:"GET" \
  Origin:"http://site.com" \
  Accept-Encoding:"gzip, deflate" \
  ...

Cool beans

Oh and you can also install httpie. The output of curlformat is compatible with httpie.

:copyright:

curlformat © 2014+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors.

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

Current Tags

  • 0.1.0                                ...           latest (6 years ago)

3 Versions

  • 0.1.0                                ...           6 years ago
  • 0.0.2                                ...           6 years ago
  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |