-
-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
I want to send custom response using
Workerman\Protocols\Http\Response
$response = new Response(200, [
'Content-Type' => 'application/json',
'Content-Encoding' => 'zstd'
], $compressedData);
$connection->send($response);but I get error
TypeError: Adapterman\Http::encode(): Argument #1 ($content) must be of type string, Workerman\Protocols\Http\Response given,
called in /root/www/vendor/workerman/workerman/src/Connection/TcpConnection.php on line 463 and defined in /root/www/vendor/joanhey/adapterman/src/Http.php:469
If I write $connection->send($compressedData);, the browser can't handle it and displays strange characters because the browser considers it as plain text. How do I set the correct header?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels