diff --git a/client/rpc_client.go b/client/rpc_client.go index d1cdd706..6e78db4a 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -67,6 +67,8 @@ func (r *rpcClient) call(ctx context.Context, address string, req Request, resp msg.Header["Timeout"] = fmt.Sprintf("%d", opts.RequestTimeout) // set the content type for the request msg.Header["Content-Type"] = req.ContentType() + // set the accept header + msg.Header["Accept"] = req.ContentType() cf, err := r.newCodec(req.ContentType()) if err != nil { @@ -142,6 +144,8 @@ func (r *rpcClient) stream(ctx context.Context, address string, req Request, opt msg.Header["Timeout"] = fmt.Sprintf("%d", opts.RequestTimeout) // set the content type for the request msg.Header["Content-Type"] = req.ContentType() + // set the accept header + msg.Header["Accept"] = req.ContentType() cf, err := r.newCodec(req.ContentType()) if err != nil {