A high-performance HTTP client desktop application built with Rust and egui, featuring a clean interface and powerful functionality for API testing and development.
┌─────────────────────────────────────────────────────────────────┐
│ Requester Desktop App │
├─────────────────────────────────────────────────────────────────┤
│ GUI Layer (egui) │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ Request UI │ │ Response UI │ │ Configuration │ │
│ │ │ │ │ │ │ │
│ │ • URL Input │ │ • Status Code │ │ • Settings │ │
│ │ • Method Select │ │ • Headers │ │ • Preferences │ │
│ │ • Headers │ │ • Body Display │ │ • History │ │
│ │ • Body Editor │ │ • JSON Format │ │ │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ Application Logic │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ RequesterApp │ │ HttpRequest │ │ HttpResponse │ │
│ │ • State Mgmt │ │ • Validation │ │ • Parsing │ │
│ │ • UI Updates │ │ • Serialization │ │ • Formatting │ │
│ │ • Persistence │ │ │ │ │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ HTTP Engine │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ reqwest │ │ tokio │ │ serde/json │ │
│ │ • HTTP Client │ │ • Async Runtime │ │ • Serialization │ │
│ │ • TLS Support │ │ • Non-blocking │ │ • JSON Parsing │ │
│ │ • Redirects │ │ • Concurrency │ │ • Formatting │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
├─────────────────────────────────────────────────────────────────┤
│ System Layer │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ OpenGL/GLES │ │ System APIs │ │ File System │ │
│ │ • Rendering │ │ • Window Mgmt │ │ • Config Store │ │
│ │ • GPU Support │ │ • Events │ │ • Persistence │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
- RequesterApp: Main application controller managing UI state and HTTP operations
- HttpRequest/HttpResponse: Type-safe data structures for HTTP communication
- HTTP Engine: Async request execution using tokio runtime and reqwest client
- GUI Thread: Main thread handling UI rendering and user interactions
- Worker Threads: Background threads for network I/O and processing
- User Input → GUI Layer captures URL, method, headers, body
- Request Validation → Application layer validates and serializes request
- HTTP Execution → Worker thread executes async HTTP request
- Response Processing → Response parsed, formatted, and stored
- UI Update → Main thread updates UI with response data
- egui (0.28): Immediate mode GUI framework
- eframe (0.28): Application framework for native windowing
- tokio (1.0): Async runtime with full features
- reqwest (0.11): HTTP client with JSON and multipart support
- serde/serde_json: Serialization framework for JSON handling
- anyhow/thiserror: Error handling and propagation
- tracing/tracing-subscriber: Structured logging
- uuid: Unique identifier generation
- chrono: Date/time handling with serialization support
- tokio-test: Async testing utilities
- serde_test: Serialization testing
- Basic testing: Built-in Rust testing framework
Rust Toolchain:
# Install Rust 1.90+ (required for latest egui)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Verify installation
rustc --version # Should be 1.90.0 or later
cargo --version # Should be 1.90.0 or laterPlatform Dependencies:
Linux (Ubuntu/Debian):
sudo apt update
sudo apt install -y \
build-essential \
pkg-config \
libssl-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libx11-dev \
libfontconfig1-dev \
libfreetype6-devLinux (Fedora/CentOS):
sudo dnf install -y \
gcc \
gcc-c++ \
pkgconfig \
openssl-devel \
mesa-libGL-devel \
libX11-devel \
fontconfig-devel \
freetype-develmacOS:
# Install Xcode Command Line Tools
xcode-select --install
# Install Homebrew (if not already installed)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install required packages
brew install opensslWindows:
# Install Visual Studio Build Tools 2019 or later
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
# Install Rust (x86_64-pc-windows-msvc target)
rustup target add x86_64-pc-windows-msvcDisplay Requirements:
- OpenGL 3.3+ compatible GPU
- Minimum resolution: 800x600 (recommended: 1200x800)
- 24-bit color depth
- Clone Repository:
git clone https://github.com/your-org/requester.git
cd requester- Verify Dependencies:
# Check Rust version
rustc --version
cargo --version
# Validate dependencies
cargo check- Build Application:
# Development build with debug symbols
cargo build
# Release build with optimizations
cargo build --release- Run Application:
# Development version
cargo run --bin requester
# Release version
./target/release/requester- Test CLI Functionality:
# Run HTTP tests without GUI
cargo run --bin test_requester# Application settings (stored in ~/.config/requester/config.toml)
application:
window_width: 1200
window_height: 800
min_window_width: 400
min_window_height: 300
theme: "dark"
http:
timeout_seconds: 30
max_redirects: 5
user_agent: "Requester/0.1.0"
verify_ssl: true
ui:
show_response_headers: true
show_response_body: true
auto_format_json: true
font_size: 14
font_family: "monospace"
persistence:
save_session_data: true
max_history_entries: 100
auto_save_interval_seconds: 30# HTTP client configuration
export REQUESTER_TIMEOUT=30 # Request timeout in seconds
export REQUESTER_USER_AGENT="Custom Agent"
export REQUESTER_PROXY="http://proxy:8080"
export REQUESTER_NO_PROXY="localhost,127.0.0.1"
# UI configuration
export REQUESTER_THEME="light" # light/dark theme
export REQUESTER_FONT_SIZE=12 # UI font size
# Development/debugging
export RUST_LOG=debug # Logging level
export REQUESTER_DEBUG=true # Enable debug mode# Standard development build
cargo build
# Optimized release build
cargo build --release
# Build with specific features
cargo build --features testing
# Build for different targets
cargo build --target x86_64-unknown-linux-gnu
cargo build --target x86_64-pc-windows-msvc
cargo build --target x86_64-apple-darwin
# Build with custom profile
cargo build --profile custom-releaserequester/
├── Cargo.toml # Main dependencies and configuration
├── Cargo.lock # Locked dependency versions
├── README.md # This documentation
├── .gitignore # Git ignore patterns
├── src/
│ ├── main.rs # GUI application entry point
│ ├── test_main.rs # CLI test application
│ ├── lib.rs # Library interface
│ └── http_types.rs # HTTP data structures
├── target/ # Build output directory
│ ├── debug/ # Development builds
│ ├── release/ # Release builds
│ └── doc/ # Generated documentation
├── tests/ # Test suites
│ ├── unit/ # Unit tests
│ ├── integration/ # Integration tests
│ ├── performance/ # Performance tests
│ └── edge-cases/ # Edge case tests
├── scripts/ # Demo and utility scripts
│ ├── simple-demo.ts # Simple functional demo
│ ├── demo.ts # Comprehensive demo
│ ├── cli-demo.js # CLI functionality demo
│ └── benchmark.ts # Performance benchmarks
└── benches/ # Performance benchmarks
├── http_performance.rs # HTTP client benchmarks
└── ui_performance.rs # UI rendering benchmarks
Basic GET Request:
- Launch application:
cargo run --bin requester - Enter URL:
https://api.github.com/users/octocat - Select method: GET (default)
- Click "Send Request"
- View response in bottom panel
POST Request with JSON:
- Select method: POST from dropdown
- Enter URL:
https://httpbin.org/post - Add headers:
- Key:
Content-Type, Value:application/json
- Key:
- Add request body:
{
"name": "Requester Test",
"version": "0.1.0",
"features": ["HTTP", "GUI", "Rust"]
}- Click "Send Request"
Custom Headers:
- In "Show Headers" section, add custom headers:
Authorization: Bearer your-tokenAccept: application/jsonX-Custom-Header: custom-value
- Headers are included in all subsequent requests
Run HTTP Tests:
# Execute comprehensive HTTP client tests
cargo run --bin test_requester
# Expected output:
🚀 Requester - Testing HTTP Client Functionality
===============================================
📡 Test 1: GET Request
Testing request to https://httpbin.org/get
Status: 200 OK
Duration: 245ms
Response body length: 578 characters
Response: {
"args": {},
"headers": {
"Host": "httpbin.org",
"User-Agent": "reqwest/0.11.27",
"X-Amzn-Trace-Id": "Root=..."
},
"origin": "192.168.1.100",
"url": "https://httpbin.org/get"
}
📤 Test 2: POST Request with JSON
Testing request to https://httpbin.org/post
Status: 200 OK
Duration: 312ms
Response body length: 892 characters
❌ Test 3: Error Handling
Testing request to non-existent URL
Expected error: error sending request for url (https://this-domain-does-not-exist-12345.com/test): dns error: failed to lookup address information
Testing 404 error...
Status: 404 Not Found
Duration: 189ms
✅ All tests completed successfully!Run in Development Mode:
# Start with debug logging
RUST_LOG=debug cargo run --bin requester
# Start with custom window size
cargo run --bin requester -- --width 1600 --height 900Run Tests:
# Run all tests
cargo test
# Run specific test
cargo test test_get_request
# Run tests with output
cargo test -- --nocapture
# Generate test coverage (requires cargo-tarpaulin)
cargo install cargo-tarpaulin
cargo tarpaulin --out HtmlPerformance Benchmarking:
# Run HTTP performance benchmarks
cargo bench --bench http_performance
# Run UI performance benchmarks
cargo bench --bench ui_performance
# Generate HTML benchmark reports
cargo bench --bench http_performance -- --output-format htmlDemo Scripts:
# Run functional demo (requires tsx installation)
npm install -g tsx
tsx scripts/simple-demo.ts
# Run mock server for testing
tsx scripts/mock-server.ts
# Test CLI functionality
cargo run --bin test_requesterAPI Testing Workflow:
# 1. Test authentication endpoint
# POST https://api.example.com/auth/login
# Headers: Content-Type: application/json
# Body: {"username":"user","password":"pass"}
# 2. Use returned token for authenticated requests
# GET https://api.example.com/users
# Headers: Authorization: Bearer returned-token
# 3. Test data creation
# POST https://api.example.com/users
# Headers: Authorization: Bearer token, Content-Type: application/json
# Body: {"name":"New User","email":"user@example.com"}Debugging HTTP Issues:
# Enable debug logging to see request/response details
RUST_LOG=debug cargo run --bin test_requester
# Check DNS resolution
curl -v https://httpbin.org/get
# Test with different HTTP methods
curl -X POST -H "Content-Type: application/json" \
-d '{"test":"data"}' \
https://httpbin.org/postUnit Tests:
# Run unit tests
cargo test --lib
# Run specific unit test
cargo test unit::http_client::test_request_validation
# Run with detailed output
cargo test --lib -- --nocaptureIntegration Tests:
# Run integration tests
cargo test --test '*'
# Run specific integration test
cargo test integration::test_complete_workflow
# Run async tests
cargo test --test async_testsTest Coverage:
# Run tests with coverage (requires cargo-tarpaulin)
cargo install cargo-tarpaulin
cargo tarpaulin --out Html --output-dir coverage/HTTP Client Benchmarks:
# Run comprehensive benchmarks
cargo bench
# Run specific benchmark
cargo bench --bench http_performance -- test_get_request
# Run with custom parameters
cargo bench --bench http_performance -- --sample-size 1000Expected Benchmark Results:
HTTP Performance Benchmarks
===========================
test_get_request time: [2.45 ms 2.51 ms 2.58 ms]
test_post_request time: [3.12 ms 3.20 ms 3.29 ms]
test_concurrent_requests time: [15.2 ms 15.8 ms 16.5 ms]
UI Performance Benchmarks
=========================
test_ui_render time: [1.2 ms 1.3 ms 1.4 ms]
test_window_resize time: [5.8 ms 6.2 ms 6.7 ms]
test_response_render time: [2.1 ms 2.3 ms 2.6 ms]
1. Setup Development Environment:
# Install development dependencies
cargo install cargo-watch cargo-expand cargo-audit
# Watch for changes and rebuild
cargo watch -x run --bin requester
# Expand macros for debugging
cargo expand --bin requester2. Code Quality Checks:
# Format code
cargo fmt
# Run clippy lints
cargo clippy -- -D warnings
# Check for security vulnerabilities
cargo audit
# Run all quality checks
cargo fmt && cargo clippy && cargo test3. Release Preparation:
# Run full test suite
cargo test --all-features
# Build release version
cargo build --release
# Check binary size
ls -lh target/release/requester
# Test release binary
./target/release/requester --versionBinary Information:
- Release Build Size: 8.2MB
- Debug Build Size: ~15MB
- Dependencies: 474 crates
- Supported Platforms: Linux, macOS, Windows
HTTP Client Features:
- Supported Methods: GET, POST, PUT, DELETE, PATCH, HEAD, OPTIONS
- Authentication: Bearer token, Basic auth support
- Headers: Custom headers supported
- Response Handling: JSON parsing and display
GUI Features:
- Framework: egui immediate mode GUI
- Layout: Two-panel design (request/response)
- Response Display: Formatted JSON, headers, status codes
- Real-time Updates: Response display after request completion
Known Limitations:
- Response Size: Practical limit ~10MB (UI becomes slow)
- Concurrent Requests: Limited by system file descriptors
- Memory Usage: Grows with response size (linear)
- File Upload: Limited by available RAM for multipart data
Performance Recommendations:
- Use release build for production use
- Limit response body size to <5MB for best UX
- Restart application after prolonged heavy use (>1000 requests)
- Monitor memory usage when handling large responses
High Memory Usage:
# Monitor memory consumption
htop | grep requester
# Check for memory leaks (valgrind)
valgrind --tool=memcheck ./target/release/requester
# Profile memory usage
cargo run --bin requester --features memory-profilingSlow Startup:
# Check disk I/O
iotop -p $(pgrep requester)
# Profile startup time
cargo build --release && time ./target/release/requester
# Check for slow dependency loading
RUST_LOG=debug cargo run --bin requester 2>&1 | grep "tokio\|egui"UI Lag:
# Check GPU driver issues
glxinfo | grep "OpenGL version"
# Force software rendering (for testing)
LIBGL_ALWAYS_SOFTWARE=1 cargo run --bin requester
# Monitor GPU usage
nvidia-smi -l 1 | grep requesterBuild Errors:
# Error: "Failed to compile openssl-sys"
# Solution: Install OpenSSL development headers
sudo apt install libssl-dev # Ubuntu/Debian
brew install openssl # macOS
# Error: "No OpenGL found"
# Solution: Install graphics drivers and libraries
sudo apt install libgl1-mesa-dev # LinuxRuntime Issues:
# Issue: Application window doesn't appear
# Solution: Check display server and graphics drivers
echo $DISPLAY
xdpyinfo | grep "dimensions"
# Issue: "Permission denied" on network requests
# Solution: Check firewall and network configuration
curl -I https://httpbin.org/get
# Issue: Application crashes on startup
# Solution: Run with debug logging
RUST_LOG=debug cargo run --bin requesterGUI Issues:
# Issue: Rendering artifacts or missing UI elements
# Solution: Update graphics drivers or try software rendering
LIBGL_ALWAYS_SOFTWARE=1 cargo run --bin requester
# Issue: Window size incorrect
# Solution: Delete application config and restart
rm -rf ~/.config/requester/
cargo run --bin requesterHTTP Issues:
# Issue: Requests time out
# Solution: Check network connectivity and DNS
ping httpbin.org
nslookup httpbin.org
# Issue: SSL/TLS errors
# Solution: Update CA certificates or disable verification (testing only)
sudo update-ca-certificates
export REQUESTER_VERIFY_SSL=falseEnable Comprehensive Debugging:
# Maximum debug output
RUST_LOG=trace REQUESTER_DEBUG=true cargo run --bin requester
# Network debugging only
RUST_LOG=reqwest=debug cargo run --bin requester
# UI debugging only
RUST_LOG=egui=debug cargo run --bin requesterGenerate Debug Information:
# Build with debug symbols
cargo build
# Run with debugger
gdb target/debug/requester
# Generate core dump on crash
ulimit -c unlimited
cargo run --bin requesterCurrent Limitations:
- Async Response Handling: Current implementation shows placeholder instead of actual async response
- State Persistence: Settings are not actually persisted between sessions
- Request History: No history or bookmark functionality implemented
- Memory Growth: Long-running sessions may accumulate memory usage
- Large Response Handling: UI becomes slow with responses >5MB
Planned Fixes:
- Implement proper async UI communication channels
- Add configuration file persistence
- Implement request history and collections
- Add memory cleanup and response size limits
- Optimize UI rendering for large responses
Community Resources:
- GitHub Issues: https://github.com/your-org/requester/issues
- Documentation: https://docs.rs/egui/ and https://docs.rs/reqwest/
- Rust Discord: https://discord.gg/rust-lang
Bug Reports: When reporting bugs, include:
- Operating system and version
- Rust and Cargo versions (
rustc -V,cargo -V) - GPU driver information
- Error messages and backtraces
- Steps to reproduce the issue
Feature Requests: Feature requests should include:
- Clear description of the feature
- Use case and motivation
- Proposed implementation approach
- Mockups or examples (if applicable)