E
E
embiid2021-07-31 18:37:04
C++ / C#
embiid, 2021-07-31 18:37:04

How can I transfer a request from one service to a second service?

How can I transfer a request from one service to a second service via sdk.

I need from one service to call the second one by post-request. For example, there is such a request that takes a boolean value as a parameter:

public Task Method(bool force = false)
            => this.PostAsync(new RequestParameters(
                Routes.ControllerRoute.RouteSuffix));


And I don't understand how can I pass this force parameter to this Method: method?
Here is an example of one RequestParameters constructor:
public RequestParameters(
            string route, 
            Dictionary<string, string> queryParams = null,
            Dictionary<string, string> pathParams = null,
            CancellationToken cancellationToken = default)
        {
            RouteParameters = new RouteParameters(route, queryParams, pathParams);
            CancellationToken = cancellationToken;
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vasily Bannikov, 2021-08-01
@embiid

Most likely - through query parameters. route?force=true
If calling RequestParameters, then:

var parameters = new RequestParameters(route, new Dictionary<string, string> { ["force"] = "true"});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question