I need to pass query parameters and path parameters to HttpClient GetAsync() method in .NET
File/{document_id}?version={version_number}
[Route("api/drs/v1/document/getdetails/{Id}")]
[HttpGet]
public async Task<HttpResponseMessage> DocumentDetails(HttpRequestMessage details)
{
// Debugger.Launch();
try
{
using (HttpClient client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Clear();
//String path=Request.Url.GetLeftPart(UriPartial.Path);
HttpResponseMessage response = await client.GetAsync("http://localhost:8089/api/drs/v1/document/getdetail/"]);
if (response.IsSuccessStatusCode)
{
Console.Write("Success");
}
else
{
Console.Write("Failure");
}
return response;
}
}
catch (Exception e)
{
throw e;
}
}
I can't pass both the parameter in GetAsync() method