HTTP/API Packet
This CLI example builds a deterministic request/response packet without calling an external service. It models `Obj` request data, `HTTP` helpers, headers, JSON, dates, flags, strings, and deterministic content IDs.
Run It
composer install
php examples/http/api_packet.php
Expected Output
{
"request": {
"method": "GET",
"url": "https://api.example.test/v1/Example%20Report.md?limit=3&include=summary&active=true",
"scheme": "https",
"host": "api.example.test",
"path_segment": "Example%20Report.md"
},
"headers": [
"Accept: application/json",
"X-Request-Date: 2026-07-12",
"X-Request-Id: api_..."
],
"expected_response": {
"status": "HTTP/1.1 202 Accepted",
"body": {"accepted": true, "message": "queued"}
},
"content_id": "api-example:..."
}