using System.Collections.Generic;
using System.Threading.Tasks;
private static readonly HttpClient _Client = new HttpClient();
static void Main(string[] args)
string url = "http://www.example.com/api/Customer";
var json = "{ \"claim_id\": \"\", \"limit\":\"10\"}";
var response = await Request(HttpMethod.Post, url, json, new Dictionary<string, string>());
string responseText = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseText);
static async Task<HttpResponseMessage> Request(HttpMethod pMethod, string pUrl, string pJsonContent, Dictionary<string, string> pHeaders)
var httpRequestMessage = new HttpRequestMessage();
httpRequestMessage.Method = pMethod;
httpRequestMessage.RequestUri = new Uri(pUrl);
foreach (var head in pHeaders)
httpRequestMessage.Headers.Add(head.Key, head.Value);
HttpContent httpContent = new StringContent(pJsonContent, Encoding.UTF8, "application/json");
httpRequestMessage.Content = httpContent;
return await _Client.SendAsync(httpRequestMessage);