From b8241f3026924607b28ab911cb04b523d6b97f80 Mon Sep 17 00:00:00 2001 From: Asim Date: Thu, 25 Aug 2016 13:34:47 +0100 Subject: [PATCH] specify the Accept header along with Content-Type --- client/rpc_client.go | 4 ++++ 1 file changed, 4 insertions(+) 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 {