i have the following code for grpc:
val port = 9090
val channel = ManagedChannelBuilder
.forAddress("grpc.friday.fastek.ph", port)
.useTransportSecurity()
.build()
try {
val client = FastekBeepClient(channel)
client.stmBalance()
i added the headers this way…
val metadata = io.grpc.Metadata()
metadata.put(Metadata.Key.of("authorization", Metadata.ASCII_STRING_MARSHALLER),"Bearer token...")
then call the rpc method this way..
client.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(metadata))
.stmBalance(intialRequest))
take note that i needed to add authorization as header as it was needed
Im still getting UNAVAILABLE status but when i tried it on postman it was working..