Skip to content

rstacruz/curlformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 'https://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 "https://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 "https://site.com/users" \
  Connection:"keep-alive" \
  Access-Control-Request-Method:"GET" \
  Origin:"https://site.com" \
  Accept-Encoding:"gzip, deflate" \
  ...

Cool beans

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

©️

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

About

CLI utility to clean up your "Copy as cURL" strings

Resources

Stars

Watchers

Forks

Packages

No packages published