# HTTPie CLI — Modern User-Friendly Command-Line HTTP Client > HTTPie is a modern, user-friendly command-line HTTP client for the API era. Intuitive syntax, formatted and colorized output, JSON support, sessions, authentication, file uploads, and plugins. The friendly alternative to curl for API exploration. ## Install Copy the content below into your project: ## Quick Use ```bash # Install brew install httpie # macOS sudo apt install httpie # Debian/Ubuntu pip install httpie # Python ``` Basic usage: ```bash http GET https://api.github.com/users/williamwangai http POST https://api.example.com/users name=William email=w@example.com http PUT https://api.example.com/users/1 name=Alice http DELETE https://api.example.com/users/1 # Headers http GET https://api.example.com Authorization:"Bearer token" X-Custom:value # JSON body http POST api.example.com/users <<<"{\"name\":\"William\"}" # File upload http --form POST api.example.com/upload file@./photo.jpg # Download http --download https://example.com/file.zip # Sessions (persist cookies/auth) http --session=work api.example.com/login name=william password=secret http --session=work api.example.com/me ``` ## Intro HTTPie is a modern command-line HTTP client designed for humans. Its goal is to make CLI interaction with web services as human-friendly as possible. Provides a simple http command that allows for sending arbitrary HTTP requests using a simple and natural syntax, and displays colorized output. - **Repo**: https://github.com/httpie/cli - **Stars**: 37K+ - **Language**: Python - **License**: BSD 3-Clause ## What HTTPie Does - **Simple syntax** — `http GET url` instead of `curl -X GET url` - **JSON by default** — `key=value` builds JSON request body - **Colorized output** — syntax-highlighted response - **Sessions** — persist cookies and auth across requests - **File uploads** — `file@path` syntax - **Downloads** — `--download` flag - **Auth** — Basic, Bearer, Digest, HAWK - **Plugins** — auth, transport, formatter plugins - **Offline mode** — preview what would be sent - **HTTPS** — verify certs, client certs ## Architecture Python-based CLI wrapping the Requests library (and newer python-httpx under the hood). Custom parser for the intuitive request syntax. Pygments for output highlighting. ## Self-Hosting CLI tool, Python package. ## Key Features - Human-friendly syntax - JSON-first - Colorized and formatted output - Sessions - Plugin architecture - File uploads - Downloads with progress bar - Local and remote HTTPS - Offline request preview ## Comparison | Tool | Syntax | JSON | Colors | |---|---|---|---| | HTTPie | Intuitive | Native | Yes | | curl | POSIX | Manual | No | | wget | POSIX | Manual | No | | xh | Intuitive (fork) | Native | Yes (Rust) | | Hurl | Own DSL | Native | Yes | ## FAQ **Q: How does it compare to curl?** A: curl is the Swiss Army knife (uploads, socks, HTTP2/3, all kinds of low-level options); HTTPie is human-friendly (REST/JSON interaction). Use HTTPie for daily API debugging and curl for low-level details. **Q: Is there something faster?** A: xh (a Rust rewrite, faster startup, HTTPie-compatible syntax), but HTTPie has a larger plugin ecosystem. **Q: Does it support GraphQL?** A: Yes. Use httpie-plugin-graphql or just POST a JSON body directly. ## Sources - Docs: https://httpie.io/docs - GitHub: https://github.com/httpie/cli - License: BSD 3-Clause --- Source: https://tokrepo.com/en/workflows/httpie-cli-modern-user-friendly-command-line-http-client-224cd323 Author: Script Depot