Request & Response

How does the PSR-7 implementation work and how can we use it?

Introduction

Phapi is PSR-7 compliant but does not implement the interfaces itself, instead Phapi depends on the zend-diactoros implementation. See the PSR-7 interfaces for more information about how to use them:

Extended methods

Body

Use the withUnserializedBody(array $data) method on the response object to add or modify the body. The serializer middleware will then serialize the body and set the serialized string as the response body.