# HTTPie
> A user-friendly command-line HTTP client for the API era

## Summary
A user-friendly HTTP client for the command line. Provides intuitive syntax for making API requests with automatic JSON handling and colorized output.

## Capabilities
- Intuitive command syntax for HTTP requests
- Automatic JSON serialization and syntax highlighting
- Persistent sessions and authentication support
- File uploads and downloads

## When to Use
- Testing and debugging REST APIs interactively
- Want more readable output than curl for JSON APIs
- Need persistent sessions for API exploration

## When NOT to Use
- Scripting where curl's ubiquity and stability are preferred
- Need to match exact curl flags from documentation

## Key Flags
- `--json / -j`: Explicitly set the request content type to JSON
- `--form / -f`: Send data as form-encoded instead of JSON
- `--auth / -a`: Provide authentication credentials (user:password)
- `--download / -d`: Download the response body to a file (like wget)
- `--session`: Create or reuse a named session for persistent cookies and headers

## Usage Patterns
### GET request with JSON response
```
http GET https://api.example.com/users
```
Fetches and displays JSON with syntax highlighting

### POST JSON data
```
http POST https://api.example.com/users name=John email=john@example.com
```
Sends JSON body with key=value pairs automatically serialized

## Input / Output
- **stdout**: Formatted and colorized HTTP response (headers and body)

## Installation
- **homebrew**: `brew install httpie`
- **apt**: `sudo apt install httpie`
- **pip**: `pip install httpie`
- **pacman**: `sudo pacman -S httpie`

## Related Tools
- [xh](/tools/xh) (alternative): xh is a Rust reimplementation inspired by HTTPie
- [curlie](/tools/curlie) (alternative): curlie wraps curl with HTTPie-like output

---
Source: https://littlescripts.sh/tools/httpie
