HTTP/2 Support
Enable HTTP/2 protocol with multiplexing for faster, more efficient API requests.
Overview
HTTP/2 offers significant performance improvements over HTTP/1.1 including multiplexing, header compression, and better connection utilization. Enable it with the --http2 flag to take advantage of modern server infrastructure.
Multiplexing
Multiple requests over a single connection
Lower Latency
Reduced connection overhead and faster responses
Header Compression
Automatic HPACK compression for headers
Basic Usage
Enable HTTP/2 with the --http2 CLI flag.
# Enable HTTP/2 for all requests
curl-runner api.yaml --http2
# Combine with other flags
curl-runner api.yaml --http2 -p -v
# Run a directory with HTTP/2
curl-runner tests/ --http2YAML Configuration
Configure HTTP/2 in your YAML files globally or per-request.
Global Configuration
# Enable HTTP/2 globally via defaults
global:
defaults:
http2: true
requests:
- name: Get Users
url: https://api.example.com/users
method: GET
- name: Get Posts
url: https://api.example.com/posts
method: GETPer-Request Configuration
# Enable HTTP/2 per request
requests:
- name: HTTP/2 Request
url: https://api.example.com/data
http2: true
- name: HTTP/1.1 Request
url: https://legacy-api.example.com/data
http2: falseEnvironment Variables
Enable HTTP/2 via environment variable for scripted workflows and CI/CD pipelines.
CURL_RUNNER_HTTP2Enable HTTP/2 protocol (true/false)# Enable HTTP/2 via environment variable
CURL_RUNNER_HTTP2=true curl-runner api.yaml
# Useful in scripts or CI/CD
export CURL_RUNNER_HTTP2=true
curl-runner tests/With Parallel Execution
Combine HTTP/2 with parallel execution for maximum performance. HTTP/2 multiplexing works particularly well with concurrent requests.
# Combine HTTP/2 with parallel execution for maximum performance
curl-runner api.yaml --http2 -p --max-concurrent 10
# YAML configuration
global:
execution: parallel
maxConcurrency: 10
defaults:
http2: true
requests:
- name: Request 1
url: https://api.example.com/endpoint1
- name: Request 2
url: https://api.example.com/endpoint2
- name: Request 3
url: https://api.example.com/endpoint3