I have the following Web Api method signature
public HttpResponseMessage GetGroups(MyRequest myRequest)
In the client, how do I pass MyRequest to the calling method?
Currently, I have something like this
var request = new MyRequest()
{
RequestId = Guid.NewGuid().ToString()
};
var response = client.GetAsync("api/groups").Result;
How can I pass request to GetAsync?
If it's a POST method, I can do something like this
var response = client.PostAsJsonAsync("api/groups", request).Result;