# HTTPie Configuration and Defaults
## Rule
Use HTTPie's config.json to set consistent defaults across your team. Configure default headers, output format, and SSL verification. Share the config template, not the actual credentials.
## Format
```json
{
"default_options": [
"--style=monokai",
"--print=hHbB",
"--timeout=30"
]
}
```
## Config Location
```bash
# Default locations
# Linux/macOS: ~/.config/httpie/config.json
# Windows: %APPDATA%\httpie\config.json
# Check current config
http --debug 2>&1 | grep config
```
## Good Examples
```json
{
"default_options": [
"--style=monokai",
"--pretty=all",
"--timeout=30",
"--check-status"
]
}
```
```bash
# Use --check-status to fail on HTTP errors
http --check-status GET api.example.com/health
# Exit code 4 for 4xx, 5 for 5xx errors — great for scripting
# Structured output for piping
http --print=b --output=response.json GET api.example.com/data
```
## Bad Examples
```bash
# BAD: Disabling SSL verification permanently
http --verify=no GET https://api.example.com
# Fix the certificate instead
# BAD: No timeout — hangs forever on network issues
http GET slow-api.example.com/data
# Always set --timeout in config or per-request
```
## Enforcement
- Share a config.json template in project documentation
- Set --check-status as default for CI/scripting use
- Always configure timeouts to prevent hanging requests