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