话不多说直接上代码
private var stub:ReaderGrpc.ReaderBlockingStub?=null
stub = ReaderGrpc.newBlockingStub(CHANNEL)
var meadata = Metadata()
meadata.put(Metadata.Key.of("paramas1", Metadata.ASCII_STRING_MARSHALLER),"1")
meadata.put(Metadata.Key.of("paramas2", Metadata.ASCII_STRING_MARSHALLER), "2")
stub = MetadataUtils.attachHeaders(stub, meadata)
网友评论