Replies: 1 comment
-
Solved: I got the expected array format using code below on "http2 server side" code....
And, on the "client-side (calling)" code :
Note: For ease of understanding, the client-side code above is expandable to:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am getting expected Array as "string" type (under last key ["data"]) in HTTP2 Response object from Swoole's http2 server, why it is a string ? and how to get it back into array().
Details:
The code for server is on this official link:
https://www.swoole.co.uk/docs/modules/swoole-server-taskCo
with added setting 'open_http2_protocol' => true, to make it http2.
And,
Swoole function to send back response object changed to:
$response->end(print_r($result, true));
The client is the last code snippet on official document:
https://www.swoole.co.uk/docs/modules/swoole-coroutine-http2-client
where i am using:
var_dump($cli->read());
instead of $cli->recv();
Here is the complete http2 response (response object) below. i have pointed out the string in response below :
Beta Was this translation helpful? Give feedback.
All reactions