Skip to content

Request Collector

Captures incoming HTTP request and response details — method, path, headers, query parameters, status code, and raw bodies.

Request Collector panel

What It Captures

FieldDescription
requestUrlFull request URL
requestPathURL path
requestQueryQuery string
requestMethodHTTP method (GET, POST, etc.)
requestIsAjaxWhether it's an AJAX/XHR request
userIpClient IP address
responseStatusCodeResponse HTTP status code
requestFull PSR-7 ServerRequest object
requestRawRaw HTTP request
responseFull PSR-7 Response object
responseRawRaw HTTP response

Data Schema

json
{
    "requestUrl": "http://app.local/users?page=2",
    "requestPath": "/users",
    "requestQuery": "page=2",
    "requestMethod": "GET",
    "requestIsAjax": false,
    "userIp": "127.0.0.1",
    "responseStatusCode": 200,
    "requestRaw": "GET /users?page=2 HTTP/1.1\r\nHost: app.local\r\n\r\n",
    "responseRaw": "HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\n..."
}

Summary (shown in debug entry list):

json
{
    "request": {
        "url": "http://app.local/users?page=2",
        "path": "/users",
        "query": "page=2",
        "method": "GET",
        "isAjax": false,
        "userIp": "127.0.0.1"
    },
    "response": {
        "statusCode": 200
    }
}

Contract

php
use AppDevPanel\Kernel\Collector\Web\RequestCollector;

$collector->collectRequest(request: $serverRequest);
$collector->collectResponse(response: $response);

How It Works

Framework adapters collect the PSR-7 request at the beginning of the middleware pipeline and the response at the end. The collector stores both the parsed objects and raw HTTP representations.

Debug Panel

  • Request/Response tabs — switch between request and response views
  • Headers table — filterable header key-value pairs
  • Raw view — full HTTP request/response as raw text
  • Parsed view — structured view of query params, body, cookies
  • Status badge — color-coded response status (2xx green, 4xx orange, 5xx red)
  • Repeat request — button to re-send the same request
  • Copy cURL — copy the request as a cURL command

Released under the MIT License.