You are viewing documentation for an outdated version. It is no longer supported!
Http Messages
Offers a few PSR-7 Http Message utilities.
Request/Response Serializer Example
Amongst the utilities are request and response serializers, able to serialize a to string
or array
.
$factory = $this->getHttpSerializerFactory();
$serializer = $factory->make($response);
echo (string) $serializer;
// Example Output:
//
// HTTP/1.1 201 Created
// Content-Type: application/json
//
// {"id":458712,"name":"Sven Jr.","age":27}