Repository navigation
EmptyResponse
Viames Marino edited this page Apr 22, 2026
·
1 revision
Pair\Http\EmptyResponse is an explicit response object for status-only responses.
It sends configured headers and an HTTP status code without emitting a body.
Arguments:
-
httpCode: HTTP status code. -
headers: additional response headers keyed by header name.
Example:
use Pair\Http\EmptyResponse;
return new EmptyResponse(304, [
'ETag' => '"abc123"',
'Cache-Control' => 'public, max-age=300',
]);EmptyResponse is mainly used by HttpCache for 304 Not Modified responses.
Use JsonResponse or TextResponse when the endpoint has a response body.
When APP_DEBUG=true and observability debug headers are enabled, send() also emits Pair correlation and trace timing headers.
See also: HttpCache, JsonResponse, TextResponse, Observability, ResponseInterface.
Maintained by Viames Marino — VM Ingegneria · Professional enquiries
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4