Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Params
Params is an object used by the gRPC methods that generate RPC requests. Params contains request-specific options like headers that should be inserted into the request.
Example of custom metadata headers and tags
import grpc from 'k6/net/grpc';
const client = new grpc.Client();
client.load([], 'route_guide.proto');
export default function () {
const req = {
latitude: 410248224,
longitude: -747127767,
};
const params = {
metadata: {
'x-my-header': 'k6test',
'x-my-header-bin': new Uint8Array([1, 2, 3]),
},
tags: { k6test: 'yes' },
};
const response = client.invoke('main.RouteGuide/GetFeature', req, params);
}