Complete documentation of all functions and data structures
Core HTTP client functionality
QUIC protocol and HTTP/3
Migration and 0-RTT
WebSocket protocol
Resilience patterns
Request/response pipeline
HTTP caching layer
Observability system
High-level HTTP client with automatic protocol negotiation
Creates a new HTTP client with default configuration.
Pointer to new client, or NULL on failure
jvr_client_t* client = jvr_client_create();
// Use client...
jvr_client_destroy(client);
Creates a new HTTP client with custom configuration.
| Name | Type | Description |
|---|---|---|
| config | const jvr_client_config_t* | Client configuration |
Pointer to new client, or NULL on failure
Destroys a client and frees all resources.
| Name | Type | Description |
|---|---|---|
| client | jvr_client_t* | Client to destroy |
Creates a new HTTP request.
| Name | Type | Description |
|---|---|---|
| method | const char* | HTTP method (GET, POST, etc.) |
| url | const char* | Target URL |
Pointer to new request, or NULL on failure
Sets a custom HTTP header on the request.
| Name | Type | Description |
|---|---|---|
| request | jvr_request_t* | Request object |
| name | const char* | Header name |
| value | const char* | Header value |
JVR_OK on success, error code otherwise
Sets the request body data.
| Name | Type | Description |
|---|---|---|
| request | jvr_request_t* | Request object |
| data | const void* | Body data |
| size | size_t | Data size in bytes |
Sends an HTTP request and waits for response.
| Name | Type | Description |
|---|---|---|
| client | jvr_client_t* | HTTP client |
| request | jvr_request_t* | Request to send |
Pointer to response object, or NULL on failure
Creates a new QUIC connection.
Establishes QUIC connection to server.
Creates a new QUIC stream.
Sends data on a QUIC stream.
🚀 Features available ONLY in JVR NetStack!
Enables connection migration on a QUIC connection.
Note: This allows seamless network switching (WiFi ↔ cellular).
Migrates connection to a new network path.
| Name | Type | Description |
|---|---|---|
| conn | jvr_quic_connection_t* | QUIC connection |
| new_address | const char* | New IP address |
| new_port | uint16_t | New port |
Enables 0-RTT for fast reconnections.
Sends data before handshake completes (0-RTT).
Saves session ticket for future 0-RTT resumption.
Restores saved session for 0-RTT.
📊 Built-in observability - ONLY in JVR NetStack!
Gets the global metrics registry singleton.
Starts tracking an HTTP request (auto-records latency).
Completes request tracking and records metrics.
Exports metrics in Prometheus text format.
Prints all metrics to stdout.
Client configuration structure
typedef struct {
bool prefer_http3; // Prefer HTTP/3 if available
bool prefer_http2; // Fallback to HTTP/2
uint32_t connection_timeout_ms;
uint32_t max_concurrent_streams;
bool enable_compression;
bool follow_redirects;
uint32_t max_redirects;
} jvr_client_config_t;
HTTP response structure
typedef struct {
int status_code; // HTTP status code
char* body; // Response body
size_t body_size; // Body size in bytes
jvr_headers_t* headers; // Response headers
} jvr_response_t;
| Constant | Value | Description |
|---|---|---|
JVR_OK |
0 | Success |
JVR_ERROR_INVALID_ARG |
-1 | Invalid argument |
JVR_ERROR_NOMEM |
-2 | Out of memory |
JVR_ERROR_TIMEOUT |
-3 | Operation timed out |
JVR_ERROR_CONNECTION |
-4 | Connection failed |
JVR_ERROR_TLS |
-5 | TLS/SSL error |