Last Updated: February 12, 2017
·
29.3K
· creaktive

Chrome Developer Tools adds "Copy as cURL"

Tired of copying & pasting URL/headers from Chrome Developer Tools to the terminal window?
The latest Chrome release (26.0) adds "Copy as Curl" option to the network panel to reproduce any network request via curl:

Screenshot

Now, in your clipboard:

curl "https://api.metacpan.org/release/_search" \
 -H "Origin: http://cpan-u.sysd.org" \
 -H "Accept-Encoding: gzip,deflate,sdch" \
 -H "Host: api.metacpan.org" \
 -H "Accept-Language: en-US,en;q=0.8" \
 -H "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.43 Safari/537.31" \
 -H "Content-Type: application/x-www-form-urlencoded; charset=UTF-8" \
 -H "Accept: application/json, text/javascript, */*; q=0.01" \
 -H "Referer: http://cpan-u.sysd.org/" \
 -H "Connection: keep-alive" \
 -H "DNT: 1" -H "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" \
 --data "source=%7B%22query%22%3A%7B%22terms%22%3A%7B%22distribution%22%3A%5B%22Moose%22%2C%22Mojolicious%22%2C%22perl%22%2C%22DBIx-Class%22%2C%22DBI%22%2C%22Plack%22%2C%22Dancer%22%2C%22App-cpanminus%22%2C%22Moo%22%2C%22DateTime%22%5D%7D%7D%2C%22filter%22%3A%7B%22term%22%3A%7B%22release.status%22%3A%22latest%22%7D%7D%2C%22fields%22%3A%5B%22distribution%22%2C%22abstract%22%2C%22version%22%5D%2C%22size%22%3A5000%7D"

2 Responses
Add your response

Hi. I just wrote a guide about that, here is the link:
http://blog.vanamco.com/chrome-devtools-features-making-web-dev-efficient/
If you want to check it out.
Thanks
Angelo

over 1 year ago ·

oh. awesome, thank you.

over 1 year ago ·