I am new to WEB API and need to get data from AF database through web API in csharp code.
When you say CSharp, I understand .NET Framework and am wondering why not use PI AF SDK for the purpose?
If you have a strong reason to prefer PI Web API, I recommend using HttpClient.
I suggest you to start with Working with PI Web API - HttpClient in C#
You could search PI Square for "HttpClient" to potentially find additional related discussions.
I agree with Gregor, if you're using C# might as well use the AF SDK directly instead of PI Web API.
Well, security constraints would a valid reason.
Retrieving data ...