Security and Technology

httpstat – Curl Statistics Made Simple

httpstat visualizes curl(1) statistics in a way of beauty and clarity.

It is a single file Python script that has no dependency and is compatible with Python 3.
Installation There are three ways to get httpstat :

Download the script directly: wget http://ift.tt/2drIbFS

Through pip: pip install httpstat

Through homebrew (macOS only): brew install httpstat

Usage Simply:

python httpstat.py httpbin.org/get

If installed through pip or brew, you can use httpstat as a command:

httpstat httpbin.org/get

cURL Options Because httpstat is a wrapper of cURL, you can pass any cURL supported option after the url (except for -w , -D , -o , -s , -S which are already used by httpstat ):

httpstat httpbin.org/post -X POST –data-urlencode “a=b” -v

Environment Variables httpstat has a bunch of environment variables to control its behavior. Here are some usage demos, you can also run httpstat –help to see full explanation.

HTTPSTAT_SHOW_BODY

HTTPSTAT_SHOW_IP

HTTPSTAT_SHOW_SPEED

HTTPSTAT_SAVE_BODY

HTTPSTAT_CURL_BIN

HTTPSTAT_DEBUG

Set to true to see debugging logs. Default is false For convenience, you can export these environments in your .zshrc or .bashrc , example:

export HTTPSTAT_SHOW_IP=falseexport HTTPSTAT_SHOW_SPEED=trueexport HTTPSTAT_SAVE_BODY=false

Related Projects Here are some implementations in various languages:

Bash: b4b4r07/httpstat This is what exactly I want to do at the very beginning, but gave up due to not confident in my bash skill, good job!

Node: yosuke-furukawa/httpstat b4b4r07 mentioned this in his article , could be used as a HTTP client also.

Go: davecheney/httpstat I’m practicing Go recently, it’s happy to read and learn from this one.

Go (library): tcnksm/go-httpstat Other than being a cli tool, this project is used as library to help debugging latency of HTTP requests in Go code, very thoughtful and useful, see more in this article

PHP: talhasch/php-httpstat The PHP implementation by @talhasch

Some code blocks in httpstat are copied from other projects of mine, have a look:

reorx/python-terminal-color Drop-in single file library for printing terminal color.

reorx/getenv Environment variable definition with type.

Download httpstat http://ift.tt/2fnafgN http://ift.tt/2aM8QhC

Deixe uma resposta

Preencha os seus dados abaixo ou clique em um ícone para log in:

Logotipo do WordPress.com

Você está comentando utilizando sua conta WordPress.com. Sair / Alterar )

Imagem do Twitter

Você está comentando utilizando sua conta Twitter. Sair / Alterar )

Foto do Facebook

Você está comentando utilizando sua conta Facebook. Sair / Alterar )

Foto do Google+

Você está comentando utilizando sua conta Google+. Sair / Alterar )

Conectando a %s