DOCUMENTATION / PREVIEW
Zephyrus/Documentation/HTTP

A first look at the field guide. The framework is evolving. Chapters and API examples will be finalized with the next update.

HTTP

Every response, explicit.

Request and response objects are central to Zephyrus. This chapter will explain their structure and how immutability shapes the flow through an application.

Intentional changes

A response can be created with an explicit status. Updating a header returns a new response object.

use Zephyrus\Http\Response;

$response = Response::json(['created' => true], 201);
$response = $response->withHeader('Cache-Control', 'no-store');

return $response;

What this chapter will cover

  • The request object and its typed parts
  • JSON, HTML and redirect responses
  • Headers, status codes and immutability
  • The response lifecycle

Reference in preparation This example is illustrative. The complete API will be documented against the updated core.

↑ ↓ NAVIGATE   ↵ OPENTHE ZEPHYRUS FIELD GUIDE