|
|
@ -209,14 +209,12 @@ func (client *Client) Invoke(ctx context.Context, path string, args interface{}, |
|
|
|
reqBody io.Reader |
|
|
|
reqBody io.Reader |
|
|
|
contentType string |
|
|
|
contentType string |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
c := defaultCallInfo() |
|
|
|
c := defaultCallInfo() |
|
|
|
for _, o := range opts { |
|
|
|
for _, o := range opts { |
|
|
|
if err := o.before(&c); err != nil { |
|
|
|
if err := o.before(&c); err != nil { |
|
|
|
return err |
|
|
|
return err |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if args != nil { |
|
|
|
if args != nil { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
body []byte |
|
|
|
body []byte |
|
|
@ -239,14 +237,8 @@ func (client *Client) Invoke(ctx context.Context, path string, args interface{}, |
|
|
|
if client.userAgent != "" { |
|
|
|
if client.userAgent != "" { |
|
|
|
req.Header.Set("User-Agent", client.userAgent) |
|
|
|
req.Header.Set("User-Agent", client.userAgent) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ctx = transport.NewContext(ctx, transport.Transport{Kind: transport.KindHTTP, Endpoint: client.endpoint}) |
|
|
|
ctx = transport.NewContext(ctx, transport.Transport{Kind: transport.KindHTTP}) |
|
|
|
ctx = NewClientContext(ctx, ClientInfo{PathPattern: c.pathPattern, Request: req}) |
|
|
|
ctx = NewClientContext(ctx, ClientInfo{ |
|
|
|
|
|
|
|
Target: client.endpoint, |
|
|
|
|
|
|
|
PathPattern: c.pathPattern, |
|
|
|
|
|
|
|
Request: req, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return client.invoke(ctx, req, args, reply, c) |
|
|
|
return client.invoke(ctx, req, args, reply, c) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|