Metadata from server
antham opened this issue · comments
Hi, I can't figure out how to send metadatas from server, do you have any clue about that ?
Hi,
sorry about not mentioning about this part in documentation (still waiting to focus on it more).
You can send metadata using the default context and "google.golang.org/grpc/metadata":
https://github.com/spiral/php-grpc/blob/master/proxy_test.go#L108
You can receive it using Context:
https://github.com/spiral/php-grpc/blob/master/tests/GRPC/ContextTest.php
Yes but from the php server you can't do this ?
You should be able to. Check the official client documentation, I can also see metadata in here:
https://github.com/grpc/grpc/blob/master/src/php/lib/Grpc/UnaryCall.php
Ok thanks for your answer I will check that
Hi @antham @gigi the requested functionality is now implemented: https://github.com/spiral/php-grpc/blob/master/tests/src/Test/TestService.php#L64
$ctx->getValue(GRPC\ResponseHeaders::class)->set('foo', 'bar');
Thanks for this information @wolfgang-braun
More docs are here: https://spiral.dev/docs/grpc-client