Using httpie instead curl
22 de Julho de 2014, 14:22 - sem comentários aindaI love curl, curl is awesome to test many services like HTTP/HTTPS, FTP, IMAP, etc. But, curl sometimes is hard to use for my customers. So, I have recommended for them to use the httpie.
In my main job, I use curl/httpie to see HTTP headers and cache problems. Then, when I have show some evidence for him, I prefer show with httpie.
A simple example using only HTTP headers.
curl1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Easy and simple, right? But this isn’t the most cool feature. The most cool httpie feature is the STDOUT colorized.
However, curl and httpie has a little bit difference. The curl option “-I” use the HEAD HTTP method and httpie use GET HTTP method. The HEAD HTTP method can’t work in all scenarios because a firewall, IPS or WAF can block this method.
To the curl has the same behavior that httpie and using GET HTTP method, it must use more options:
curl1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
To add HTTP headers using curl, have to use “-H” option. For example, adding HTTP header to disable keep-alive connection.
curl1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
And with httpie more simple…
httpie1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
An another example is to add HTTP headers if need identify if a URI is cacheable a CDN. This case was tested in site that use Akamai.
curl1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
The same test but with httpie.
httpie1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
If you want search about Akamai HTTP headers, go to Stackoverflow link.
Conclusion is if need something more friendly, use httpie. But if you need run tests more complex curl is the tool.
P.S. Install httpie is simple a Debian like. Debian has official package.
1
|
|
Using httpie instead curl
22 de Julho de 2014, 14:22 - sem comentários aindaI love curl, curl is awesome to test many services like HTTP/HTTPS, FTP, IMAP, etc. But, curl sometimes is hard to use for my customers. So, I have recommended for them to use the httpie.
In my main job, I use curl/httpie to see HTTP headers and cache problems. Then, when I have show some evidence for him, I prefer show with httpie.
A simple example using only HTTP headers.
curl1 2 3 4 5 6 7 8 9 10 11 12 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
Easy and simple, right? But this isn’t the most cool feature. The most cool httpie feature is the STDOUT colorized.
However, curl and httpie has a little bit difference. The curl option “-I” use the HEAD HTTP method and httpie use GET HTTP method. The HEAD HTTP method can’t work in all scenarios because a firewall, IPS or WAF can block this method.
To the curl has the same behavior that httpie and using GET HTTP method, it must use more options:
curl1 2 3 4 5 6 7 8 9 10 11 12 13 |
|
To add HTTP headers using curl, have to use “-H” option. For example, adding HTTP header to disable keep-alive connection.
curl1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
And with httpie more simple…
httpie1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
An another example is to add HTTP headers if need identify if a URI is cacheable a CDN. This case was tested in site that use Akamai.
curl1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
The same test but with httpie.
httpie1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
If you want search about Akamai HTTP headers, go to Stackoverflow link.
Conclusion is if need something more friendly, use httpie. But if you need run tests more complex curl is the tool.
P.S. Install httpie is simple a Debian like. Debian has official package.
1
|
|
Entendendo um pouco mais sobre containers
10 de Julho de 2014, 12:49 - sem comentários aindaSe está curioso em saber mais sobre containers Linux, especificamente sobre o Docker e como foi implementado. No blog do DotCloud tem alguns textos do Jérôme Petazzoni detalhando sobre o Docker e como funciona.
- PaaS under the hood, episode 1: kernel namespaces
- PaaS Under the Hood, Episode 2: cgroups
- PAAS Under the Hood, Episode 3: AUFS
- PaaS Under the Hood, Episode 4: GRSEC
- PaaS under the hood, episode 5: Distributed routing with Hipache
- PaaS Under the Hood, Episode 6: How to Optimize the Memory Usage of Your Apps
Tem um epub deles um menor mas legal de ler.